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

wip working in Batches instance

parent 37837dcd
from copy import copy
import json
import time
import random
import operator
from datetime import datetime
from dream.plugins import plugin
class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin):
""" Input prepration
read wip-srpeadsheet data and update the wip property of the stations.
"""
def preprocess(self, data):
""" Set the WIP in queue from spreadsheet data.
"""
wipData=data['input'].get('wip_spreadsheet', None)
node=data['graph']['node']
if wipData:
wipData.pop(0) # pop the column names
for wipItem in wipData:
partId=wipItem[0]
# in case there is no id, do not process the element
if not partId:
continue
stationId=wipItem[1]
numberOfUnits=wipItem[2]
unitsToProcess=wipItem[3]
if not unitsToProcess:
unitsToProcess=numberOfUnits
_class="Dream."+wipItem[4]
parentBatchId=wipItem[5]
wip=node[stationId].get('wip',[])
if not wip:
node[stationId]['wip']=[]
node[stationId]['wip'].append({
"_class": _class,
"id": partId,
"name": partId,
"numberOfUnits":numberOfUnits,
"unitsToProcess":unitsToProcess,
"parentBatchId":parentBatchId
})
return data
\ No newline at end of file
from copy import copy
import json
import time
import random
import operator
from datetime import datetime
from dream.plugins import plugin
class ReadShiftFromSpreadsheet(plugin.InputPreparationPlugin):
""" Input prepration
read wip-srpeadsheet data and update the wip property of the stations.
"""
def preprocess(self, data):
return data
\ No newline at end of file
......@@ -833,25 +833,23 @@
},
"preprocessing" : {
"plugin_list" : [{
"plugin" : "ReadShiftFromSpreadsheet",
"plugin" : "ReadShiftFromSpreadsheet.ReadShiftFromSpreadsheet",
"input_id" : "ShiftSpreadsheet"
}, {
"plugin" : "ReadWipFromSpreadsheet",
"plugin" : "BatchesWIPSpreadsheet.BatchesWIPSpreadsheet",
"input_id" : "WipSpreadsheet"
}
]
},
"processing" : {
"plugin_list" : [{
"plugin" : "plugin.PartJobShop",
"plugin" : "plugin.DefaultExecutionPlugin",
"input_id" : "Simulation"
}
]
},
"postprocessing" : {
"plugin_list" : [{
"plugin" : "CalculateConfidenceIntervals"
}
"plugin_list" : [
]
},
"general" : {
......
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