Commit 9a458a97 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

CoreObject and Machine update in order to prepare pre-emption

parent d7f8254c
......@@ -90,6 +90,7 @@ class CoreObject(Process):
self.failureTimeInCurrentEntity=0
self.setupTimeCurrentEntity=0
self.shouldPreempt=False #flag that shows that the machine should preempt or not
self.Failure=[]
self.Working=[]
......
......@@ -139,9 +139,19 @@ class Machine(CoreObject):
self.failureTimeInCurrentEntity+=now()-breakTime # dummy variable keeping track of the failure time
# output to trace that the Machine self.objName was passivated for the current failure time
self.outputTrace(self.getActiveObjectQueue()[0].name, "passivated in "+self.objName+" for "+str(now()-breakTime))
#if during the interruption the object became empty break
if (len(self.getActiveObjectQueue())==0 and self.shouldPreempt):
break
# if no interruption occurred the processing in M1 is ended
else:
processingNotFinished=False
#if during the interruption the object became empty continue
if (len(self.getActiveObjectQueue())==0 and self.shouldPreempt):
self.shouldPreempt=False
continue
# output to trace that the processing in the Machine self.objName ended
self.outputTrace(self.getActiveObjectQueue()[0].name,"ended processing in "+self.objName)
# set the variable that flags an Entity is ready to be disposed
......@@ -175,6 +185,13 @@ class Machine(CoreObject):
self.downTimeInCurrentEntity+=now()-failTime # already updated from failures during processing
# update the timeLastFailureEnded
self.timeLastFailureEnded=now()
#if during the interruption the object became empty break
if (len(self.getActiveObjectQueue())==0 and self.shouldPreempt):
self.shouldPreempt==False
break
# =======================================================================
# checks if the machine is Up
# =======================================================================
......
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