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

Entity and Exit updated so that number of units can be counted in cases that involve Batches

parent 89259874
...@@ -53,7 +53,8 @@ class Entity(object): ...@@ -53,7 +53,8 @@ class Entity(object):
# values to be used in the internal processing of compoundObjects # values to be used in the internal processing of compoundObjects
self.internal = False # informs if the entity is being processed internally self.internal = False # informs if the entity is being processed internally
self.isCritical=isCritical # flag to inform weather the entity is critical -> preemption self.isCritical=isCritical # flag to inform weather the entity is critical -> preemption
self.manager=None self.manager=None # default value
self.numberOfUnits=1 # default value
# ======================================================================= # =======================================================================
# outputs results to JSON File # outputs results to JSON File
......
...@@ -61,6 +61,7 @@ class Exit(CoreObject): ...@@ -61,6 +61,7 @@ class Exit(CoreObject):
# The number of resource that exited through this exit. # The number of resource that exited through this exit.
# XXX bug: cannot output as json when nothing has exited. # XXX bug: cannot output as json when nothing has exited.
self.numOfExits=0 self.numOfExits=0
self.totalNumberOfUnitsExited=0
self.totalLifespan=0 self.totalLifespan=0
self.totalTaktTime=0 # the total time between to consecutive exits self.totalTaktTime=0 # the total time between to consecutive exits
...@@ -112,9 +113,10 @@ class Exit(CoreObject): ...@@ -112,9 +113,10 @@ class Exit(CoreObject):
def getEntity(self): def getEntity(self):
activeEntity = CoreObject.getEntity(self) #run the default method activeEntity = CoreObject.getEntity(self) #run the default method
self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one. self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one.
self.numOfExits+=1 # increase the exits by one self.numOfExits+=1 # increase the exits by one
self.totalTaktTime+=now()-self.timeLastEntityLeft # add the takt time self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits # add the number of units that xited
self.timeLastEntityLeft=now() # update the time that the last entity left from the Exit self.totalTaktTime+=now()-self.timeLastEntityLeft # add the takt time
self.timeLastEntityLeft=now() # update the time that the last entity left from the Exit
return activeEntity return activeEntity
# ======================================================================= # =======================================================================
......
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