Commit cfb6dad4 authored by Georgios Dagkakis's avatar Georgios Dagkakis

if there is not batch in the spreadsheets, define a dummy shift so that the...

if there is not batch in the spreadsheets, define a dummy shift so that the element will be off all through the simulation time
parent 595d5908
...@@ -20,6 +20,7 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -20,6 +20,7 @@ class BatchesShift(ReadShiftFromSpreadsheet):
nodes=data['graph']['node'] nodes=data['graph']['node']
machineshiftData=data['input'].get('machine_shift_spreadsheet', None) machineshiftData=data['input'].get('machine_shift_spreadsheet', None)
operatorshiftData=data['input'].get('operator_shift_spreadsheet', None) operatorshiftData=data['input'].get('operator_shift_spreadsheet', None)
maxSimTime=data['general']['maxSimTime']
# create a string with all station ids separated by commas # create a string with all station ids separated by commas
allString='' allString=''
...@@ -49,11 +50,21 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -49,11 +50,21 @@ class BatchesShift(ReadShiftFromSpreadsheet):
# set attributes to shifts # set attributes to shifts
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
interruptions=node.get('interruptions',None) if "BatchScrapMachine" in node['_class'] or "M3" in node['_class'] or node['_class']=="Dream.Operator":
if interruptions: shiftExists=False
shift=interruptions.get('shift',None) interruptions=node.get('interruptions',None)
if shift: if interruptions:
interruptions['shift']['thresholdTimeIsOnShift']=0 shift=interruptions.get('shift',None)
interruptions['shift']['receiveBeforeEndThreshold']=7 if shift:
interruptions['shift']['endUnfinished']=1 interruptions['shift']['thresholdTimeIsOnShift']=0
interruptions['shift']['receiveBeforeEndThreshold']=7
interruptions['shift']['endUnfinished']=1
shiftExists=True
# if element has no shift defined in the spreadsheet it needs to be off-shift. For this we declare a dummy
# shift that is on-shift only after the completion of simulation
if not shiftExists:
print 'Setting for', node_id
node['interruptions']=node.get('interruptions',{})
node['interruptions']['shift']={}
node['interruptions']['shift']['shiftPattern']=[[maxSimTime+1,maxSimTime+2]]
return data return data
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