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

further enhancement in Source

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