Commit 59b20ed5 authored by Georgios Dagkakis's avatar Georgios Dagkakis

other objects to use any_of, test time dropped from 70-75 to 60-65

parent 2f553e34
......@@ -81,7 +81,7 @@ class BatchDecomposition(CoreObject):
while 1:
# wait for an event or an interruption
while 1:
receivedEvent=yield self.isRequested | self.interruptionStart | self.initialWIP
receivedEvent=yield self.env.any_of([self.isRequested , self.interruptionStart , self.initialWIP])
# if an interruption has occurred
if self.interruptionStart in receivedEvent:
assert self.interruptionStart.value==self.env.now, 'the interruption received by batchDecomposition was created earlier'
......
......@@ -77,7 +77,7 @@ class BatchReassembly(CoreObject):
self.initialSignalReceiver()
while 1:
while 1:
receivedEvent=yield self.isRequested | self.interruptionStart | self.initialWIP
receivedEvent=yield self.env.any_of([self.isRequested , self.interruptionStart , self.initialWIP])
if self.interruptionStart in receivedEvent:
assert self.interruptionStart.value==self.env.now, 'the interruptionStart received by BatchReassembly later than created'
self.interruptionStart=self.env.event()
......@@ -117,7 +117,7 @@ class BatchReassembly(CoreObject):
self.isProcessingInitialWIP=False
if not self.signalReceiver():
while 1:
receivedEvent=yield self.canDispose | self.interruptionStart
receivedEvent=yield self.env.any_of([self.canDispose , self.interruptionStart])
if self.canDispose in receivedEvent:
self.canDispose=self.env.event()
if self.interruptionStart in receivedEvent:
......
......@@ -104,7 +104,7 @@ class Conveyer(CoreObject):
self.conveyerMover.canMove.succeed(self.env.now)
self.printTrace(self.id, waitEvent='')
receivedEvent=yield self.isRequested | self.canDispose | self.moveEnd # , self.loadOperatorAvailable]
receivedEvent=yield self.env.any_of([self.isRequested , self.canDispose , self.moveEnd]) # , self.loadOperatorAvailable]
# if the event that activated the thread is isRequested then getEntity
if self.isRequested in receivedEvent:
self.printTrace(self.id, isRequested='')
......
......@@ -72,7 +72,7 @@ class OrderDecomposition(CoreObject):
self.initialSignalReceiver()
while 1:
#wait until the Queue can accept an entity and one predecessor requests it
receivedEvent=yield self.isRequested | self.canDispose
receivedEvent=yield self.env.any_of([self.isRequested , self.canDispose])
# if the event that activated the thread is isRequested then getEntity
if self.isRequested in receivedEvent:
self.isRequested=self.env.event()
......
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