Commit cf5f5497 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

findPending (entities and objects) now checks whether an entity has...

findPending (entities and objects) now checks whether an entity has checkIfRequiredPartsReady before adding it to the pending list
parent 847d92ce
...@@ -63,6 +63,8 @@ class Router(ObjectInterruption): ...@@ -63,6 +63,8 @@ class Router(ObjectInterruption):
self.criticalQueues=[] self.criticalQueues=[]
self.pending=[] # list of entities that require operators now
#=========================================================================== #===========================================================================
# the initialize method # the initialize method
#=========================================================================== #===========================================================================
...@@ -92,6 +94,8 @@ class Router(ObjectInterruption): ...@@ -92,6 +94,8 @@ class Router(ObjectInterruption):
self.criticalQueues=[] self.criticalQueues=[]
self.pending=[] # list of entities that require operators now
# ======================================================================= # =======================================================================
# the run method # the run method
# ======================================================================= # =======================================================================
...@@ -174,7 +178,6 @@ class Router(ObjectInterruption): ...@@ -174,7 +178,6 @@ class Router(ObjectInterruption):
# for all the operators that are requested # for all the operators that are requested
for operator in self.candidateOperators: for operator in self.candidateOperators:
if operator.candidateStation: if operator.candidateStation:
# check if the candidateOperators are available, if the are requested and reside in the pendingObjects list # check if the candidateOperators are available, if the are requested and reside in the pendingObjects list
if operator.checkIfResourceIsAvailable(): if operator.checkIfResourceIsAvailable():
# assign an operator to the priorityObject # assign an operator to the priorityObject
...@@ -194,6 +197,9 @@ class Router(ObjectInterruption): ...@@ -194,6 +197,9 @@ class Router(ObjectInterruption):
self.toBeSignalled.append(operator.candidateStation) self.toBeSignalled.append(operator.candidateStation)
self.printTrace('objects to be signaled:'+' '*11, [str(object.id) for object in self.toBeSignalled]) self.printTrace('objects to be signaled:'+' '*11, [str(object.id) for object in self.toBeSignalled])
#===========================================================================
# entry actions
#===========================================================================
def entry(self): def entry(self):
from Globals import G from Globals import G
for operator in G.OperatorsList: for operator in G.OperatorsList:
...@@ -224,6 +230,7 @@ class Router(ObjectInterruption): ...@@ -224,6 +230,7 @@ class Router(ObjectInterruption):
del self.conflictingEntities[:] del self.conflictingEntities[:]
del self.occupiedReceivers[:] del self.occupiedReceivers[:]
del self.criticalQueues[:] del self.criticalQueues[:]
del self.pending[:]
self.invoked=False self.invoked=False
...@@ -267,14 +274,13 @@ class Router(ObjectInterruption): ...@@ -267,14 +274,13 @@ class Router(ObjectInterruption):
#=========================================================================== #===========================================================================
def findPending(self): def findPending(self):
from Globals import G from Globals import G
self.pending=[] # list of entities that require operators now
for entity in G.pendingEntities: for entity in G.pendingEntities:
if entity.currentStation in G.MachineList: if entity.currentStation in G.MachineList:
if entity.currentStation.broker.waitForOperator: if entity.currentStation.broker.waitForOperator:
self.pendingMachines.append(entity.currentStation) self.pendingMachines.append(entity.currentStation)
self.pending.append(entity) self.pending.append(entity)
for machine in entity.currentStation.next: for machine in entity.currentStation.next:
if machine in G.MachineList: if machine in G.MachineList and entity.checkIfRequiredPartsReady():
if any(type=='Load' for type in machine.multOperationTypeList) and not entity.currentStation in self.pendingQueues: if any(type=='Load' for type in machine.multOperationTypeList) and not entity.currentStation in self.pendingQueues:
self.pendingQueues.append(entity.currentStation) self.pendingQueues.append(entity.currentStation)
self.pending.append(entity) self.pending.append(entity)
......
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