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,6 +50,8 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -49,6 +50,8 @@ 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():
if "BatchScrapMachine" in node['_class'] or "M3" in node['_class'] or node['_class']=="Dream.Operator":
shiftExists=False
interruptions=node.get('interruptions',None) interruptions=node.get('interruptions',None)
if interruptions: if interruptions:
shift=interruptions.get('shift',None) shift=interruptions.get('shift',None)
...@@ -56,4 +59,12 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -56,4 +59,12 @@ class BatchesShift(ReadShiftFromSpreadsheet):
interruptions['shift']['thresholdTimeIsOnShift']=0 interruptions['shift']['thresholdTimeIsOnShift']=0
interruptions['shift']['receiveBeforeEndThreshold']=7 interruptions['shift']['receiveBeforeEndThreshold']=7
interruptions['shift']['endUnfinished']=1 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