Commit 66b46061 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

currentOperator of victim choosen according to the assignments of the router

parent 975fd768
...@@ -132,7 +132,14 @@ class Broker(ObjectInterruption): ...@@ -132,7 +132,14 @@ class Broker(ObjectInterruption):
assert self.victim.operatorPool.checkIfResourceIsAvailable(), 'there is no available operator to request' assert self.victim.operatorPool.checkIfResourceIsAvailable(), 'there is no available operator to request'
# set the available resource as the currentOperator # set the available resource as the currentOperator
self.victim.currentOperator=self.victim.operatorPool.findAvailableOperator() currentOperator=None
for operator in self.victim.operatorPool.operators:
if operator.isAssignedTo()==self.victim:
currentOperator=operator
break
self.victim.currentOperator=currentOperator
if not currentOperator:
self.victim.currentOperator=self.victim.operatorPool.findAvailableOperator()
with self.victim.operatorPool.getResource(self.victim.currentOperator).request() as request: with self.victim.operatorPool.getResource(self.victim.currentOperator).request() as request:
......
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