Commit 4773c9ef authored by Georgios Dagkakis's avatar Georgios Dagkakis

normalize schedule so that gantt does not output different line if the same...

normalize schedule so that gantt does not output different line if the same operator is reallocated to the same machine
parent 12727f30
......@@ -5,6 +5,7 @@ from pprint import pformat
from dream.plugins import plugin
from dream.plugins.TimeSupport import TimeSupportMixin
import datetime
from copy import copy
class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
......@@ -53,8 +54,20 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
type='operator',
open=False)
schedule=copy(element['results']['schedule'])
k=0
for record in schedule:
for nextRecord in schedule[k+1:]:
if nextRecord['stationId']==record['stationId'] and not record is schedule[-1]:
if operatorId=='PB_1':
print 'removing',nextRecord, 'cause of', record
schedule.remove(nextRecord)
else:
continue
k+=1
# print schedule
k=1
schedule=element['results']['schedule']
for record in schedule:
entranceTime=record['entranceTime']
try:
......
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