Commit 623ed13b authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

jobShop objects make use of expectedSignals dict

parent 14bb3fc6
...@@ -292,6 +292,7 @@ class MachineJobShop(Machine): ...@@ -292,6 +292,7 @@ class MachineJobShop(Machine):
self.receiver.timeLastEntityEnded=self.env.now #required to count blockage correctly in the preemptied station self.receiver.timeLastEntityEnded=self.env.now #required to count blockage correctly in the preemptied station
# TODO: use a signal and wait for it, reactivation is not recognised as interruption # TODO: use a signal and wait for it, reactivation is not recognised as interruption
# reactivate(self) # reactivate(self)
if self.expectedSignals['preemptQueue']:
succeedTuple=(self,self.env.now) succeedTuple=(self,self.env.now)
self.preemptQueue.succeed(succeedTuple) self.preemptQueue.succeed(succeedTuple)
# TODO: consider the case when a failure has the Station down. The event preempt will not be received now() # TODO: consider the case when a failure has the Station down. The event preempt will not be received now()
......
...@@ -110,6 +110,7 @@ class MouldAssemblyBuffer(QueueManagedJob): ...@@ -110,6 +110,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
for secondary in [x for x in activeEntity.order.secondaryComponentsList if activeEntity.order.basicsEnded]: for secondary in [x for x in activeEntity.order.secondaryComponentsList if activeEntity.order.basicsEnded]:
if secondary.currentStation.__class__.__name__=='ConditionalBuffer': if secondary.currentStation.__class__.__name__=='ConditionalBuffer':
# print now(), self.id, ' signalling conditional buffer' # print now(), self.id, ' signalling conditional buffer'
if secondary.currentStation.expectedSignals['canDispose']:
succeedTuple=(self,self.env.now) succeedTuple=(self,self.env.now)
secondary.currentStation.canDispose.succeed(succeedTuple) secondary.currentStation.canDispose.succeed(succeedTuple)
break break
......
...@@ -72,6 +72,10 @@ class OrderDecomposition(CoreObject): ...@@ -72,6 +72,10 @@ class OrderDecomposition(CoreObject):
self.initialSignalReceiver() self.initialSignalReceiver()
while 1: while 1:
#wait until the Queue can accept an entity and one predecessor requests it #wait until the Queue can accept an entity and one predecessor requests it
self.expectedSignals['isRequested']=1
self.expectedSignals['canDispose']=1
receivedEvent=yield self.env.any_of([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 the event that activated the thread is isRequested then getEntity
if self.isRequested in receivedEvent: if self.isRequested in receivedEvent:
...@@ -84,6 +88,10 @@ class OrderDecomposition(CoreObject): ...@@ -84,6 +88,10 @@ class OrderDecomposition(CoreObject):
if self.canDispose in receivedEvent: if self.canDispose in receivedEvent:
transmitter, eventTime=self.canDispose.value transmitter, eventTime=self.canDispose.value
self.canDispose=self.env.event() self.canDispose=self.env.event()
self.expectedSignals['isRequested']=0
self.expectedSignals['canDispose']=0
# if the event that activated the thread is canDispose then signalReceiver # if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose(): if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from generator' # print now(), self.id, 'will try to signal a receiver from generator'
......
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