Commit 4320b0f8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Machine.run to use checkIfActive instead of checking flags

parent 2c821d81
...@@ -497,7 +497,7 @@ class Machine(CoreObject): ...@@ -497,7 +497,7 @@ class Machine(CoreObject):
transmitter, eventTime=self.interruptionEnd.value transmitter, eventTime=self.interruptionEnd.value
assert eventTime==self.env.now, 'the interruptionEnd was received later than anticipated' assert eventTime==self.env.now, 'the interruptionEnd was received later than anticipated'
self.interruptionEnd=self.env.event() self.interruptionEnd=self.env.event()
if self.Up and self.onShift: if self.checkIfActive():
break break
self.postInterruptionActions() # execute interruption actions self.postInterruptionActions() # execute interruption actions
#=========================================================== #===========================================================
...@@ -816,7 +816,7 @@ class Machine(CoreObject): ...@@ -816,7 +816,7 @@ class Machine(CoreObject):
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 there is no other interruption
if self.Up and self.onShift: if self.checkIfActive():
# Machine is back to blocked state # Machine is back to blocked state
self.isBlocked=True self.isBlocked=True
break break
......
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