Commit 1d3f1afa authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

correction on how blockage is calculated now that postInterruptionActions is...

correction on how blockage is calculated now that postInterruptionActions is invoked also when the object was interrupted by off-shift period
parent e5b4f635
......@@ -84,7 +84,7 @@ class CoreObject(object):
self.downTimeProcessingCurrentEntity=0 #holds the time that the machine was down while
#processing the current entity
self.downTimeInTryingToReleaseCurrentEntity=0 #holds the time that the object was down while trying
#to release the current entity
#to release the current entity . This might be due to failure, off-shift, etc
self.downTimeInCurrentEntity=0 #holds the total time that the
#object was down while holding current entity
self.timeLastEntityLeft=0 #holds the last time that an entity left the object
......@@ -211,9 +211,7 @@ class CoreObject(object):
def addBlockage(self):
self.totalTimeInCurrentEntity=self.env.now-self.timeLastEntityEntered
self.totalTimeWaitingForOperator += self.operatorWaitTimeCurrentEntity
if self.timeLastEntityEnded<self.timeLastShiftStarted:
self.offShiftTimeTryingToReleaseCurrentEntity=self.timeLastShiftStarted-self.timeLastShiftEnded
blockage=self.env.now-(self.timeLastEntityEnded+self.downTimeInTryingToReleaseCurrentEntity+self.offShiftTimeTryingToReleaseCurrentEntity)
blockage=self.env.now-(self.timeLastEntityEnded+self.downTimeInTryingToReleaseCurrentEntity)
self.totalBlockageTime+=blockage
# =======================================================================
......
......@@ -882,7 +882,7 @@ class Machine(CoreObject):
self.totalOffShiftTime+=self.env.now-self.timeLastShiftEnded
# we add the value only if it hasn't already been added
if((mightBeBlocked) and (activeObject.nameLastEntityEnded==activeObject.nameLastEntityEntered) and (not alreadyAdded)):
activeObject.totalBlockageTime+=(self.env.now-activeObject.timeLastEntityEnded)-(self.env.now-activeObject.timeLastShiftEnded)-offShiftTimeInCurrentEntity
activeObject.totalBlockageTime+=(self.env.now-activeObject.timeLastEntityEnded)-offShiftTimeInCurrentEntity
#Machine was idle when it was not in any other state
activeObject.totalWaitingTime=MaxSimtime-activeObject.totalWorkingTime-activeObject.totalBlockageTime-activeObject.totalFailureTime-activeObject.totalLoadTime-activeObject.totalSetupTime-self.totalOffShiftTime
......
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