entitiesFinishedMoving tracks entities that have to move in zero simulation time

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