Commit 3d6670a8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Queue sorter enhancement. in LPT/SPT search until there is a step with processing

parent ea3080d8
...@@ -247,20 +247,24 @@ class Queue(CoreObject): ...@@ -247,20 +247,24 @@ class Queue(CoreObject):
#if the schedulingRule is to sort Entities according to longest processing time first in the next station #if the schedulingRule is to sort Entities according to longest processing time first in the next station
elif criterion=="LPT": elif criterion=="LPT":
for entity in activeObjectQ: for entity in activeObjectQ:
processingTime = entity.remainingRoute[0].get('processingTime',None) entity.processingTimeInNextStation=None
# search in the remaining route until there is an object with processing time
for stop in entity.remainingRoute:
processingTime = stop.get('processingTime',None)
if processingTime: if processingTime:
entity.processingTimeInNextStation=float(processingTime.get('mean',0)) entity.processingTimeInNextStation=float(processingTime.get('mean',0))
else: break
entity.processingTimeInNextStation=0
activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation, reverse=True) activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation, reverse=True)
#if the schedulingRule is to sort Entities according to shortest processing time first in the next station #if the schedulingRule is to sort Entities according to shortest processing time first in the next station
elif criterion=="SPT": elif criterion=="SPT":
for entity in activeObjectQ: for entity in activeObjectQ:
processingTime = entity.remainingRoute[0].get('processingTime',None) entity.processingTimeInNextStation=None
# search in the remaining route until there is an object with processing time
for stop in entity.remainingRoute:
processingTime = stop.get('processingTime',None)
if processingTime: if processingTime:
entity.processingTimeInNextStation=float(processingTime.get('mean',0)) entity.processingTimeInNextStation=float(processingTime.get('mean',0))
else: break
entity.processingTimeInNextStation=0
activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation) activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation)
#if the schedulingRule is to sort Entities based on the minimum slackness #if the schedulingRule is to sort Entities based on the minimum slackness
elif criterion=="MS": elif criterion=="MS":
......
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