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

cleanup in conveyer blockage calculation. Dump of topology15 test changed...

cleanup in conveyer blockage calculation. Dump of topology15 test changed after 6th decimal (check diff)
parent 18a77b7a
......@@ -229,16 +229,11 @@ class Conveyer(CoreObject):
self.position.pop(0)
#revert the blockage calculation
#conveyer needs its customcalculation
blockage=now()-(self.timeLastEntityEnded+self.downTimeInTryingToReleaseCurrentEntity)
self.totalBlockageTime-=blockage
self.waitToDispose=False
#if the conveyer was full, it means that it also was blocked
#we count this blockage time
if self.wasFull:
self.totalBlockageTime+=now()-self.timeBlockageStarted
#self.totalBlockageTime+=now()-self.timeBlockageStarted
self.wasFull=False
#calculate the time that the conveyer will become available again and trigger the conveyerMover
self.timeToBecomeAvailable=((self.position[-1]+self.currentRequestedLength)/float(self.speed))/60
......@@ -246,6 +241,10 @@ class Conveyer(CoreObject):
self.call=True
return activeEntity
def addBlockage(self):
if self.wasFull:
self.totalBlockageTime+=now()-self.timeBlockageStarted
#checks if the Conveyer can dispose an entity to the following object
def haveToDispose(self, callerObject=None):
#it has meaning only if there are one or more entities in the conveyer
......
......@@ -5,8 +5,8 @@
"id": "C1",
"results": {
"working_ratio": 1.055555555555577,
"blockage_ratio": 92.05671296296346,
"waiting_ratio": 6.887731481480965
"blockage_ratio": 92.05671296296349,
"waiting_ratio": 6.887731481480949
}
},
{
......
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