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

comments clean-up in QueueManagedJob

parent a2d479bf
...@@ -50,7 +50,6 @@ class QueueManagedJob(QueueJobShop): ...@@ -50,7 +50,6 @@ class QueueManagedJob(QueueJobShop):
if entity.manager.checkIfResourceIsAvailable: if entity.manager.checkIfResourceIsAvailable:
haveEntityWithAvailableManager=True haveEntityWithAvailableManager=True
#if none of the Entities has an available manager return False #if none of the Entities has an available manager return False
if not haveEntityWithAvailableManager: if not haveEntityWithAvailableManager:
return False return False
...@@ -67,14 +66,12 @@ class QueueManagedJob(QueueJobShop): ...@@ -67,14 +66,12 @@ class QueueManagedJob(QueueJobShop):
#give the entity to the possible receiver that is waiting for the most time. #give the entity to the possible receiver that is waiting for the most time.
maxTimeWaiting=0 maxTimeWaiting=0
# loop through the object in the successor list for object in activeObject.next: # loop through the object in the successor list
for object in activeObject.next:
if(object.canAccept(activeObject)): # if the object can accept if(object.canAccept(activeObject)): # if the object can accept
timeWaiting=now()-object.timeLastEntityLeft # compare the time that it has been waiting timeWaiting=now()-object.timeLastEntityLeft # compare the time that it has been waiting
if(timeWaiting>maxTimeWaiting or maxTimeWaiting==0):# with the others' if(timeWaiting>maxTimeWaiting or maxTimeWaiting==0):# with the others'
maxTimeWaiting=timeWaiting maxTimeWaiting=timeWaiting
self.receiver=object # and update the receiver to the index of this object self.receiver=object # and update the receiver
#return True if the Queue has Entities and the caller is the receiver #return True if the Queue has Entities and the caller is the receiver
return len(activeObjectQueue)>0 and (thecaller is self.receiver) return len(activeObjectQueue)>0 and (thecaller is self.receiver)
......
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