entitiesFinishedMoving tracks entities that have to move in zero simulation time

parent 2133028f
......@@ -51,6 +51,7 @@ class Router(ObjectInterruption):
# the run method
# =======================================================================
def run(self):
from Globals import G
while 1:
# wait until the router is called
yield waituntil,self,self.routerIsCalled
......@@ -59,7 +60,6 @@ class Router(ObjectInterruption):
# before they can enter again a type-Machine object
yield waituntil, self,self.entitiesFinishedMoving
from Globals import G
for object in G.MachineList:
if object.inPositionToGet:
object.canProceedWithGetEntity=True
......@@ -90,29 +90,33 @@ class Router(ObjectInterruption):
# check if the entities waiting to be disposed from different Machines
# the first time the Router is called, have reached the last queue (if any)
# before the next Machine in their route
# from Globals import G
# # pending entities are entities about to enter an other machine, updated by endProcessingActions()
# # if there are any pending entities
# if len(G.pendingEntities):
# # for each one of them
# for entity in G.pendingEntities:
# # if they are residing in a machine which waits to dispose and is functional
# if entity.currentStation in G.MachineList:
# if entity.currentStation.checkIfMachineIsUp()\
# and entity.currentStation.waitToDispose:
# # if the next step in the entity's route is machine with Load operationType then continue
# if (not (entity.currentStation.receiver.type in G.MachineList)\
# and entity.currentStation.receiver.canAccept()\
# or\
# ((entity.currentStation.receiver.type in G.MachineList)\
# and not any(type=='Load' for type in entity.currentStation.receiver.multOperationTypeList))):
# return False
# elif entity.currentStation in G.QueueList:
# pass
# elif entity.currentStation in G.LineClearanceList:
# pass
# # this list can check all the available object in G.objList
from Globals import G
# pending entities are entities about to enter an other machine, updated by endProcessingActions()
# if there are any pending entities
if len(G.pendingEntities):
# for each one of them
for entity in G.pendingEntities:
# if they are residing in a machine which waits to dispose and is functional
if entity.currentStation in G.MachineList:
if entity.currentStation.checkIfMachineIsUp()\
and entity.currentStation.waitToDispose:
# if the next step in the entity's route is machine with Load operationType then continue
if (not (entity.currentStation.receiver in G.MachineList)\
and entity.currentStation.receiver.canAccept()\
or\
((entity.currentStation.receiver.type in G.MachineList)\
and not any(type=='Load' for type in entity.currentStation.receiver.multOperationTypeList))):
return False
# if the entity is in a Queue
elif entity.currentStation in G.QueueList:
# if the hot flag of the entity is raised
if entity.hot:
return True
else:
return False
elif entity.currentStation in G.OrderDecompositionList:
return False
# TODO: this list can check all the available object in G.objList
return True
# =======================================================================
......
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