Commit ee94b2aa authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Ioannis Papagiannopoulos

activeQSorter in Queue updated to implement scheduling rules new-style

parent 8b7ca228
...@@ -276,7 +276,7 @@ class Queue(CoreObject): ...@@ -276,7 +276,7 @@ class Queue(CoreObject):
for step in entity.remainingRoute: for step in entity.remainingRoute:
processingTime=step.get('processingTime',None) processingTime=step.get('processingTime',None)
if processingTime: if processingTime:
RPT+=float(processingTime.get('mean',0)) RPT+=float(processingTime.get('Fixed',{}).get('mean',0))
entity.remainingProcessingTime=RPT entity.remainingProcessingTime=RPT
activeObjectQ.sort(key=lambda x: x.remainingProcessingTime, reverse=True) activeObjectQ.sort(key=lambda x: x.remainingProcessingTime, reverse=True)
#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
...@@ -284,7 +284,7 @@ class Queue(CoreObject): ...@@ -284,7 +284,7 @@ class Queue(CoreObject):
for entity in activeObjectQ: for entity in activeObjectQ:
processingTime = entity.remainingRoute[0].get('processingTime',None) processingTime = entity.remainingRoute[0].get('processingTime',None)
if processingTime: if processingTime:
entity.processingTimeInNextStation=float(processingTime.get('mean',0)) entity.processingTimeInNextStation=float(processingTime.get('Fixed',{}).get('mean',0))
else: else:
entity.processingTimeInNextStation=0 entity.processingTimeInNextStation=0
activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation, reverse=True) activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation, reverse=True)
...@@ -293,7 +293,7 @@ class Queue(CoreObject): ...@@ -293,7 +293,7 @@ class Queue(CoreObject):
for entity in activeObjectQ: for entity in activeObjectQ:
processingTime = entity.remainingRoute[0].get('processingTime',None) processingTime = entity.remainingRoute[0].get('processingTime',None)
if processingTime: if processingTime:
entity.processingTimeInNextStation=float(processingTime.get('mean',0)) entity.processingTimeInNextStation=float(processingTime.get('Fixed',{}).get('mean',0))
else: else:
entity.processingTimeInNextStation=0 entity.processingTimeInNextStation=0
activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation) activeObjectQ.sort(key=lambda x: x.processingTimeInNextStation)
...@@ -304,7 +304,7 @@ class Queue(CoreObject): ...@@ -304,7 +304,7 @@ class Queue(CoreObject):
for step in entity.remainingRoute: for step in entity.remainingRoute:
processingTime=step.get('processingTime',None) processingTime=step.get('processingTime',None)
if processingTime: if processingTime:
RPT+=float(processingTime.get('mean',0)) RPT+=float(processingTime.get('Fixed',{}).get('mean',0))
entity.remainingProcessingTime=RPT entity.remainingProcessingTime=RPT
activeObjectQ.sort(key=lambda x: (x.dueDate-x.remainingProcessingTime)) activeObjectQ.sort(key=lambda x: (x.dueDate-x.remainingProcessingTime))
#if the schedulingRule is to sort Entities based on the length of the following Queue #if the schedulingRule is to sort Entities based on the length of the following Queue
......
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