Commit 682b104f authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

further clean-up in Operator and OperatorRouterManaged

parent d5284a09
...@@ -130,7 +130,7 @@ class Operator(ObjectResource): ...@@ -130,7 +130,7 @@ class Operator(ObjectResource):
if candidateMachines: if candidateMachines:
# choose the one that waits the most time and give it the chance to grasp the resource # choose the one that waits the most time and give it the chance to grasp the resource
for machine in candidateMachines: for machine in candidateMachines:
machine.critical=False # machine.critical=False
if machine.broker.waitForOperator: if machine.broker.waitForOperator:
machine.timeWaiting=self.env.now-machine.broker.timeWaitForOperatorStarted machine.timeWaiting=self.env.now-machine.broker.timeWaitForOperatorStarted
else: else:
......
...@@ -108,9 +108,15 @@ class RouterManaged(Router): ...@@ -108,9 +108,15 @@ class RouterManaged(Router):
# exit actions # exit actions
self.exitActions() self.exitActions()
#===========================================================================
# entry actions on Router call
#===========================================================================
def entryActions(self): def entryActions(self):
pass pass
#===========================================================================
# routine to allocate the operators to the stations
#===========================================================================
def allocateOperators(self): def allocateOperators(self):
# find the pending objects # find the pending objects
self.findPendingObjects() self.findPendingObjects()
...@@ -124,6 +130,9 @@ class RouterManaged(Router): ...@@ -124,6 +130,9 @@ class RouterManaged(Router):
# entities that are already in stations have already a receiver # entities that are already in stations have already a receiver
self.findCandidateReceivers() self.findCandidateReceivers()
#===========================================================================
# un-assign the exit of the objects that are not to be signalled
#===========================================================================
def unAssignExits(self): def unAssignExits(self):
for operator in [x for x in self.candidateOperators if x.isAssignedTo()]: for operator in [x for x in self.candidateOperators if x.isAssignedTo()]:
if not operator.isAssignedTo() in self.pendingObjects: if not operator.isAssignedTo() in self.pendingObjects:
...@@ -136,7 +145,7 @@ class RouterManaged(Router): ...@@ -136,7 +145,7 @@ class RouterManaged(Router):
object.unAssignExit() object.unAssignExit()
# ======================================================================= # =======================================================================
# return control to the Machine.run # Exit actions return control to the Machine.run
# ======================================================================= # =======================================================================
def exitActions(self): def exitActions(self):
# reset the candidateEntities of the operators # reset the candidateEntities of the operators
......
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