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):
# values to be used in the internal processing of compoundObjects
self.internal = False # informs if the entity is being processed internally
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
......
......@@ -61,6 +61,7 @@ class Exit(CoreObject):
# The number of resource that exited through this exit.
# XXX bug: cannot output as json when nothing has exited.
self.numOfExits=0
self.totalNumberOfUnitsExited=0
self.totalLifespan=0
self.totalTaktTime=0 # the total time between to consecutive exits
......@@ -113,6 +114,7 @@ class Exit(CoreObject):
activeEntity = CoreObject.getEntity(self) #run the default method
self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one.
self.numOfExits+=1 # increase the exits by one
self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits # add the number of units that xited
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
......
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