Commit 9308c8d3 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

previous changes revoked for speed issues

parent 295f4a31
......@@ -67,6 +67,28 @@ class ConditionalBuffer(QueueJobShop):
return activeObjectQueue[0].mayProceed
return False
#===========================================================================
# getEntity method
# ass soon as the buffer receives an entity it controls if the entity is requested elsewhere,
# then it checks if there other requested entities by the same requesting entity.
# Finally, it is controlled whether all the requested parts have concluded
# their sequences for the requesting entity
#===========================================================================
def getEntity(self):
activeEntity=QueueJobShop.getEntity(self)
from Globals import G
# for all the entities in the EntityList
for entity in G.EntityList:
requiredParts=entity.getRequiredParts()
if requiredParts:
# if the activeEntity is in the requierdParts of the entity
if activeEntity in requiredParts:
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']:
entity.mayProceed=True
self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
return activeEntity
# =======================================================================
# sort the entities of the activeQ
# bring to the front the entities that have no requestedParts for the following step in their route
......
......@@ -373,22 +373,22 @@ class CoreObject(ManPyObject):
self.updateNext(activeEntity)
self.outputTrace(activeEntity.name, "got into "+self.objName)
self.printTrace(activeEntity.name, enter=self.id)
# if there are entities with requiredParts then check whether the requirements are fulfilled for them to proceed
# ass soon as a "buffer" receives an entity it controls if the entity is requested elsewhere,
# then it checks if there other requested entities by the same requesting entity.
# Finally, it is controlled whether all the requested parts have concluded
# their sequences for the requesting entity
from Globals import G
# for all the entities in the EntityList
for entity in G.EntityList:
requiredParts=entity.getRequiredParts()
if requiredParts:
# if the activeEntity is in the requierdParts of the entity
if activeEntity in requiredParts:
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']:
entity.mayProceed=True
self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
# # if there are entities with requiredParts then check whether the requirements are fulfilled for them to proceed
# # ass soon as a "buffer" receives an entity it controls if the entity is requested elsewhere,
# # then it checks if there other requested entities by the same requesting entity.
# # Finally, it is controlled whether all the requested parts have concluded
# # their sequences for the requesting entity
# from Globals import G
# # for all the entities in the EntityList
# for entity in G.EntityList:
# requiredParts=entity.getRequiredParts()
# if requiredParts:
# # if the activeEntity is in the requierdParts of the entity
# if activeEntity in requiredParts:
# # if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
# if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']:
# entity.mayProceed=True
# self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
# if the object (eg Queue) canAccept then signal the Giver
if self.canAccept():
......
......@@ -63,4 +63,21 @@ class ExitJobShop(Exit):
if activeObject.id in activeEntity.remainingRoute[0].get('stationIdsList',[]):
return True
return False
#===========================================================================
# overides the default getEntity
#===========================================================================
def getEntity(self):
activeEntity = Exit.getEntity(self) #run the default method
from Globals import G
# for all the entities in the EntityList
for entity in G.EntityList:
requiredParts=entity.getRequiredParts()
if requiredParts:
# if the activeEntity is in the requierdParts of the entity
if activeEntity in requiredParts:
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']:
self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
return activeEntity
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment