Commit 92a03a94 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

currentOperator of victim choosen according to the assignments of the router

parent d268ba81
......@@ -132,7 +132,14 @@ class Broker(ObjectInterruption):
assert self.victim.operatorPool.checkIfResourceIsAvailable(), 'there is no available operator to request'
# 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:
......
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