Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
5c41dfd5
Commit
5c41dfd5
authored
May 09, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DemandPlanning updated to create a JSON for LineGenerationJSON
parent
cd335b24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
25 deletions
+35
-25
dream/simulation/GUI/DemandPlanning.py
dream/simulation/GUI/DemandPlanning.py
+35
-25
No files found.
dream/simulation/GUI/DemandPlanning.py
View file @
5c41dfd5
...
@@ -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
(
argumen
tDict
,
indent
=
5
)
G
.
argumentDictString
=
json
.
dumps
(
inpu
tDict
,
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment