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

further fix in Source to output trace correctly

parent 1ee632de
......@@ -46,12 +46,6 @@ class EntityGenerator(object):
self.type="EntityGenerator" #String that shows the type of object
self.victim=victim
# #===========================================================================
# # initialize method of the EntityGenerator
# #===========================================================================
# def initialize(self):
# Process.__init__(self)
#===========================================================================
# the generator of the EntitiesGenerator
#===========================================================================
......@@ -72,10 +66,9 @@ class EntityGenerator(object):
self.victim.entityCreated.succeed(entity)
# else put it on the time list for scheduled Entities
else:
#print self.env.now, 'appending to the list'
entityCounter=G.numberOfEntities+len(self.victim.scheduledEntities) # this is used just ot output the trace correctly
self.victim.scheduledEntities.append(self.env.now)
self.victim.outputTrace(entity.name, "generated") # output the trace
G.numberOfEntities+=1
self.victim.outputTrace(self.victim.item.type+str(entityCounter), "generated") # output the trace
yield self.env.timeout(self.victim.calculateInterarrivalTime()) # wait until the next arrival
#============================================================================
......@@ -104,8 +97,7 @@ class Source(CoreObject):
self.item=Globals.getClassFromName(entity) #the type of object that the Source will generate
self.scheduledEntities=[] # list of creations that are scheduled
self.scheduledEntities=[] # list of creations that are scheduled. pattern is [timeOfCreation, EntityCounter]
#===========================================================================
# The initialize method of the Source class
......
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