Commit 5c41dfd5 authored by Georgios Dagkakis's avatar Georgios Dagkakis

DemandPlanning updated to create a JSON for LineGenerationJSON

parent cd335b24
...@@ -29,6 +29,7 @@ import xlwt ...@@ -29,6 +29,7 @@ import xlwt
import xlrd import xlrd
import json import json
from AllocManagement import AllocManagement from AllocManagement import AllocManagement
from dream.simulation.LineGenerationJSON import main as simulate_line_json
from dream.simulation.Globals import G from dream.simulation.Globals import G
from dream.simulation.FutureDemandCreator import FutureDemandCreator from dream.simulation.FutureDemandCreator import FutureDemandCreator
...@@ -256,44 +257,53 @@ def main(): ...@@ -256,44 +257,53 @@ def main():
# read from inputs spreadsheet # read from inputs spreadsheet
readGeneralInput() readGeneralInput()
# open json file # open json file
argumentDictFile=open('argumentDict.json', mode='w') argumentDictFile=open('inputFile.json', mode='w')
argumentDict={} inputDict={}
argumentDict['argumentDict']={}
inputDict['_class']='Dream.Simulation'
# set general attributes # set general attributes
argumentDict['general']={} inputDict['general']={}
argumentDict['general']['maxSimTime']=G.planningHorizon inputDict['general']['maxSimTime']=G.planningHorizon
argumentDict['general']['numberOfReplications']=G.ReplicationNo inputDict['general']['numberOfReplications']=G.ReplicationNo
inputDict['general']['_class']='Dream.Simulation'
inputDict['nodes']={}
inputDict['nodes']['AM']={}
inputDict['nodes']['AM']['_class']='Dream.AllocationManagement'
inputDict['nodes']['AM']['id']='AM1'
inputDict['nodes']['AM']['name']='AM1'
inputDict['nodes']['AM']['argumentDict']={}
# set current PPOS attributes # set current PPOS attributes
argumentDict['argumentDict']['currentPPOS']={} inputDict['nodes']['AM']['argumentDict']['currentPPOS']={}
argumentDict['argumentDict']['currentPPOS']['id']=G.TargetPPOS inputDict['nodes']['AM']['argumentDict']['currentPPOS']['id']=G.TargetPPOS
argumentDict['argumentDict']['currentPPOS']['quantity']=G.TargetPPOSqty inputDict['nodes']['AM']['argumentDict']['currentPPOS']['quantity']=G.TargetPPOSqty
argumentDict['argumentDict']['currentPPOS']['targetWeek']=G.TargetPPOSweek inputDict['nodes']['AM']['argumentDict']['currentPPOS']['targetWeek']=G.TargetPPOSweek
# set allocation attributes # set allocation attributes
argumentDict['argumentDict']['allocationData']={} inputDict['nodes']['AM']['argumentDict']['allocationData']={}
argumentDict['argumentDict']['allocationData']['maxEarliness']=G.maxEarliness inputDict['nodes']['AM']['argumentDict']['allocationData']['maxEarliness']=G.maxEarliness
argumentDict['argumentDict']['allocationData']['maxLateness']=G.maxLateness inputDict['nodes']['AM']['argumentDict']['allocationData']['maxLateness']=G.maxLateness
argumentDict['argumentDict']['allocationData']['minPackingSize']=G.minPackingSize inputDict['nodes']['AM']['argumentDict']['allocationData']['minPackingSize']=G.minPackingSize
# set capacity attributes # set capacity attributes
argumentDict['argumentDict']['capacity']=G.CapacityDict inputDict['nodes']['AM']['argumentDict']['capacity']=G.CapacityDict
# set MA attributes # set MA attributes
argumentDict['argumentDict']['MAList']=G.RouteDict inputDict['nodes']['AM']['argumentDict']['MAList']=G.RouteDict
G.argumentDictString=json.dumps(argumentDict, indent=5) G.argumentDictString=json.dumps(inputDict, indent=5)
argumentDictFile.write(G.argumentDictString) argumentDictFile.write(G.argumentDictString)
# create the future demand # # create the future demand
FDC=FutureDemandCreator() # FDC=FutureDemandCreator()
FDC.run() # FDC.run()
#call the AllocManagement routine # #call the AllocManagement routine
AM = AllocManagement() # AM = AllocManagement()
AM.Run() # AM.Run()
writeOutput() # currently to excel for verification. To be outputted in JSON # writeOutput() # currently to excel for verification. To be outputted in JSON
print G.AllocationPPOS
if __name__ == '__main__': if __name__ == '__main__':
main() main()
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