Commit 95849520 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

previous changes revoked for speed issues

parent 9a76ab4e
...@@ -67,6 +67,28 @@ class ConditionalBuffer(QueueJobShop): ...@@ -67,6 +67,28 @@ class ConditionalBuffer(QueueJobShop):
return activeObjectQueue[0].mayProceed return activeObjectQueue[0].mayProceed
return False 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 # sort the entities of the activeQ
# bring to the front the entities that have no requestedParts for the following step in their route # bring to the front the entities that have no requestedParts for the following step in their route
......
...@@ -373,22 +373,22 @@ class CoreObject(ManPyObject): ...@@ -373,22 +373,22 @@ class CoreObject(ManPyObject):
self.updateNext(activeEntity) self.updateNext(activeEntity)
self.outputTrace(activeEntity.name, "got into "+self.objName) self.outputTrace(activeEntity.name, "got into "+self.objName)
self.printTrace(activeEntity.name, enter=self.id) self.printTrace(activeEntity.name, enter=self.id)
# if there are entities with requiredParts then check whether the requirements are fulfilled for them to proceed # # 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, # # 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. # # then it checks if there other requested entities by the same requesting entity.
# Finally, it is controlled whether all the requested parts have concluded # # Finally, it is controlled whether all the requested parts have concluded
# their sequences for the requesting entity # # their sequences for the requesting entity
from Globals import G # from Globals import G
# for all the entities in the EntityList # # for all the entities in the EntityList
for entity in G.EntityList: # for entity in G.EntityList:
requiredParts=entity.getRequiredParts() # requiredParts=entity.getRequiredParts()
if requiredParts: # if requiredParts:
# if the activeEntity is in the requierdParts of the entity # # if the activeEntity is in the requierdParts of the entity
if activeEntity in requiredParts: # if activeEntity in requiredParts:
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity # # if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']: # if entity.checkIfRequiredPartsReady() and entity.currentStation.expectedSignals['canDispose']:
entity.mayProceed=True # entity.mayProceed=True
self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose) # self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
# if the object (eg Queue) canAccept then signal the Giver # if the object (eg Queue) canAccept then signal the Giver
if self.canAccept(): if self.canAccept():
......
...@@ -64,3 +64,20 @@ class ExitJobShop(Exit): ...@@ -64,3 +64,20 @@ class ExitJobShop(Exit):
return True return True
return False 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