Commit 49f260a6 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Broker, do not request operator if there is already an available one

parent b49e8af9
...@@ -120,15 +120,14 @@ class Broker(ObjectInterruption): ...@@ -120,15 +120,14 @@ class Broker(ObjectInterruption):
# XXX discuss this # XXX discuss this
elif G.RouterList[0].invoked and G.RouterList[0].allocation and not self.victim.currentOperator: elif G.RouterList[0].invoked and G.RouterList[0].allocation and not self.victim.currentOperator:
self.waitForOperator=True self.waitForOperator=True
self.victim.printTrace(self.victim.id, waitEvent='(resourceIsAvailable broker)') self.victim.printTrace(self.victim.id, waitEvent='(resourceIsAvailable broker)')
self.expectedSignals['resourceAvailable']=1 if not self.victim.operatorPool.checkIfResourceIsAvailable():
self.expectedSignals['resourceAvailable']=1
yield self.resourceAvailable yield self.resourceAvailable
transmitter, eventTime=self.resourceAvailable.value
transmitter, eventTime=self.resourceAvailable.value self.resourceAvailable=self.env.event()
self.resourceAvailable=self.env.event() self.waitForOperator=False
self.waitForOperator=False
#=============================================================== #===============================================================
......
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