Commit d332d203 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Fix in winq sched rule

parent 80344dc3
...@@ -309,11 +309,14 @@ class Queue(CoreObject): ...@@ -309,11 +309,14 @@ class Queue(CoreObject):
elif criterion=="WINQ": elif criterion=="WINQ":
from Globals import G from Globals import G
for entity in activeObjectQ: for entity in activeObjectQ:
nextObjIds=entity.remainingRoute[1].get('stationIdsList',[]) if len(entity.remainingRoute)>1:
for obj in G.ObjList: nextObjIds=entity.remainingRoute[1].get('stationIdsList',[])
if obj.id in nextObjIds: for obj in G.ObjList:
nextObject=obj if obj.id in nextObjIds:
entity.nextQueueLength=len(nextObject.Res.users) nextObject=obj
entity.nextQueueLength=len(nextObject.Res.users)
else:
entity.nextQueueLength=0
activeObjectQ.sort(key=lambda x: x.nextQueueLength) activeObjectQ.sort(key=lambda x: x.nextQueueLength)
else: else:
assert False, "Unknown scheduling criterion %r" % (criterion, ) assert False, "Unknown scheduling criterion %r" % (criterion, )
......
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