Commit 4524f62f authored by Georgios Dagkakis's avatar Georgios Dagkakis

further enhancement in Source

parent b4452a2e
......@@ -67,7 +67,9 @@ class EntityGenerator(Process):
self.victim.getActiveObjectQueue().append(entity) # append the entity to the resource
self.victim.numberOfArrivals+=1 # we have one new arrival
G.numberOfEntities+=1
self.victim.entityCreated.signal(entity)
# if there is only one entity in the Source send entityCreated signal
if len(self.victim.getActiveObjectQueue())==1:
self.victim.entityCreated.signal(entity)
yield hold,self,self.victim.calculateInterarrivalTime() # wait until the next arrival
#============================================================================
......@@ -131,11 +133,8 @@ class Source(CoreObject):
if self.entityCreated.signalparam:
self.appendEntity(self.entityCreated.signalparam)
self.entityCreated.signalparam=None
# if self.signalReceiver():
# continue
if len(self.getActiveObjectQueue())==1:
if self.signalReceiver():
continue
if self.signalReceiver():
continue
# otherwise, if the receiver requests availability then try to signal him if there is anything to dispose of
if self.canDispose.signalparam:
self.canDispose.signalparam=None
......
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