Commit c7ca01c8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

correction in Machine, so that isBlocked state is updated after the end of an interruption

parent b8adf350
...@@ -759,7 +759,6 @@ class Machine(CoreObject): ...@@ -759,7 +759,6 @@ class Machine(CoreObject):
self.timeLastBlockageStarted=self.env.now # blockage is starting self.timeLastBlockageStarted=self.env.now # blockage is starting
# wait the event canDispose, this means that the station can deliver the item to successor # wait the event canDispose, this means that the station can deliver the item to successor
self.printTrace(self.id, waitEvent='(canDispose or interruption start)') self.printTrace(self.id, waitEvent='(canDispose or interruption start)')
receivedEvent=yield self.env.any_of([self.canDispose , self.interruptionStart]) receivedEvent=yield self.env.any_of([self.canDispose , self.interruptionStart])
# if there was interruption # if there was interruption
# TODO not good implementation # TODO not good implementation
...@@ -767,7 +766,7 @@ class Machine(CoreObject): ...@@ -767,7 +766,7 @@ class Machine(CoreObject):
transmitter, eventTime=self.interruptionStart.value transmitter, eventTime=self.interruptionStart.value
assert eventTime==self.env.now, 'the interruption has not been processed on the time of activation' assert eventTime==self.env.now, 'the interruption has not been processed on the time of activation'
self.interruptionStart=self.env.event() self.interruptionStart=self.env.event()
# wait for the end of the interruption # wait for the end of the interruption
self.interruptionActions() # execute interruption actions self.interruptionActions() # execute interruption actions
# loop until we reach at a state that there is no interruption # loop until we reach at a state that there is no interruption
while 1: while 1:
...@@ -779,7 +778,10 @@ class Machine(CoreObject): ...@@ -779,7 +778,10 @@ class Machine(CoreObject):
transmitter, eventTime=self.interruptionEnd.value transmitter, eventTime=self.interruptionEnd.value
assert eventTime==self.env.now, 'the victim of the failure is not the object that received it' assert eventTime==self.env.now, 'the victim of the failure is not the object that received it'
self.interruptionEnd=self.env.event() self.interruptionEnd=self.env.event()
# if there is no other interruption
if self.Up and self.onShift: if self.Up and self.onShift:
# Machine is back to blocked state
self.isBlocked=True
break break
self.postInterruptionActions() self.postInterruptionActions()
if self.signalReceiver(): if self.signalReceiver():
......
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