OperatorRouter wont signal a station if the station has already been signalled

parent c22c49a0
...@@ -262,7 +262,6 @@ class Router(ObjectInterruption): ...@@ -262,7 +262,6 @@ class Router(ObjectInterruption):
# signal stations that wait for load operators # signal stations that wait for load operators
#=========================================================================== #===========================================================================
def signalOperatedStations(self): def signalOperatedStations(self):
# print 'router trying to signal pendingObjects'
from Globals import G from Globals import G
for operator in self.candidateOperators: for operator in self.candidateOperators:
station=operator.isAssignedTo() station=operator.isAssignedTo()
...@@ -308,8 +307,10 @@ class Router(ObjectInterruption): ...@@ -308,8 +307,10 @@ class Router(ObjectInterruption):
assert operator.candidateEntity.currentStation in G.QueueList, 'the candidateEntity currentStation to receive signal from Router is not a queue' assert operator.candidateEntity.currentStation in G.QueueList, 'the candidateEntity currentStation to receive signal from Router is not a queue'
if operator.candidateEntity.candidateReceiver.canAccept()\ if operator.candidateEntity.candidateReceiver.canAccept()\
and any(type=='Load' for type in operator.candidateEntity.candidateReceiver.multOperationTypeList): and any(type=='Load' for type in operator.candidateEntity.candidateReceiver.multOperationTypeList):
self.printTrace('router','signalling queue'+' '*50+operator.candidateEntity.currentStation.id) # if the station is already is already signalled then do not send event
operator.candidateEntity.currentStation.loadOperatorAvailable.succeed(self.env.now) if not operator.candidateEntity.currentStation.loadOperatorAvailable.triggered:
self.printTrace('router','signalling queue'+' '*50+operator.candidateEntity.currentStation.id)
operator.candidateEntity.currentStation.loadOperatorAvailable.succeed(self.env.now)
#=========================================================================== #===========================================================================
# clear the pending lists of the router # clear the pending lists of the router
......
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