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
fe11a349
Commit
fe11a349
authored
May 09, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DemandPlanner made to call ManPy main JSON script
parent
9de38ede
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
dream/simulation/GUI/DemandPlanning.py
dream/simulation/GUI/DemandPlanning.py
+30
-29
No files found.
dream/simulation/GUI/DemandPlanning.py
View file @
fe11a349
...
...
@@ -31,13 +31,19 @@ import json
from
AllocManagement
import
AllocManagement
from
dream.simulation.LineGenerationJSON
import
main
as
simulate_line_json
from
dream.simulation.Globals
import
G
from
dream.simulation.FutureDemandCreator
import
FutureDemandCreator
class
IG
:
TargetPPOS
=
0
TargetPPOSqty
=
0
TargetPPOSweek
=
0
maxEarliness
=
0
# max number of weeks for earliness
maxLateness
=
0
# max number of weeks for lateness
minPackingSize
=
0
CapacityDict
=
{}
RouteDict
=
{}
def
createGlobals
():
G
.
TargetPPOS
=
0
G
.
TargetPPOSqty
=
0
G
.
TargetPPOSweek
=
0
G
.
ReplicationNo
=
0
G
.
replication
=
0
G
.
PPOSlist
=
{}
...
...
@@ -64,8 +70,7 @@ def createGlobals():
G
.
ExcessFutureBuffer
=
[]
G
.
ExcessFutureMinBuffer
=
[]
G
.
DistributionType
=
None
G
.
CapacityDict
=
{}
G
.
RouteDict
=
{}
# filterItem = 0
# filterWeek = 0
...
...
@@ -77,14 +82,14 @@ def readGeneralInput():
# general simulation input
wbin
=
xlrd
.
open_workbook
(
'GUI/inputs.xlsx'
)
sh
=
wbin
.
sheet_by_name
(
'Scalar_Var'
)
G
.
TargetPPOS
=
int
(
sh
.
cell
(
2
,
1
).
value
)
-
1
G
.
TargetPPOSqty
=
int
(
sh
.
cell
(
3
,
1
).
value
)
G
.
TargetPPOSweek
=
int
(
sh
.
cell
(
6
,
1
).
value
)
-
1
I
G
.
TargetPPOS
=
int
(
sh
.
cell
(
2
,
1
).
value
)
-
1
I
G
.
TargetPPOSqty
=
int
(
sh
.
cell
(
3
,
1
).
value
)
I
G
.
TargetPPOSweek
=
int
(
sh
.
cell
(
6
,
1
).
value
)
-
1
G
.
planningHorizon
=
int
(
sh
.
cell
(
7
,
1
).
value
)
G
.
ReplicationNo
=
int
(
sh
.
cell
(
15
,
1
).
value
)
G
.
maxEarliness
=
int
(
sh
.
cell
(
18
,
1
).
value
)
G
.
maxLateness
=
int
(
sh
.
cell
(
19
,
1
).
value
)
G
.
minPackingSize
=
int
(
sh
.
cell
(
22
,
1
).
value
)
I
G
.
maxEarliness
=
int
(
sh
.
cell
(
18
,
1
).
value
)
I
G
.
maxLateness
=
int
(
sh
.
cell
(
19
,
1
).
value
)
I
G
.
minPackingSize
=
int
(
sh
.
cell
(
22
,
1
).
value
)
# capacity information
sh
=
wbin
.
sheet_by_name
(
'Capacity'
)
...
...
@@ -105,7 +110,7 @@ def readGeneralInput():
nCols
=
sh
.
ncols
# prepare a dict that holds the capacity of every bottleneck per week
for
i
in
range
(
3
,
nCols
):
G
.
CapacityDict
[
sh
.
cell
(
2
,
i
).
value
]
=
G
.
Capacity
[
i
-
3
]
I
G
.
CapacityDict
[
sh
.
cell
(
2
,
i
).
value
]
=
G
.
Capacity
[
i
-
3
]
for
i
in
range
(
4
,
nRows
):
...
...
@@ -114,9 +119,9 @@ def readGeneralInput():
ppos
=
tempPPOSlist
[
0
]
sp
=
tempPPOSlist
[
1
]
routeValues
=
sh
.
row_values
(
i
,
3
,
nCols
)
G
.
RouteDict
[
id
]
=
{
'PPOS'
:
ppos
,
'SP'
:
sp
,
'route'
:{}}
I
G
.
RouteDict
[
id
]
=
{
'PPOS'
:
ppos
,
'SP'
:
sp
,
'route'
:{}}
for
j
in
range
(
len
(
routeValues
)):
G
.
RouteDict
[
id
][
'route'
][
sh
.
cell
(
2
,
j
+
3
).
value
]
=
routeValues
[
j
]
I
G
.
RouteDict
[
id
][
'route'
][
sh
.
cell
(
2
,
j
+
3
).
value
]
=
routeValues
[
j
]
def
writeOutput
():
...
...
@@ -268,6 +273,7 @@ def main():
inputDict
[
'general'
][
'numberOfReplications'
]
=
G
.
ReplicationNo
inputDict
[
'general'
][
'_class'
]
=
'Dream.Simulation'
inputDict
[
'edges'
]
=
{}
inputDict
[
'nodes'
]
=
{}
inputDict
[
'nodes'
][
'AM'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'_class'
]
=
'Dream.AllocationManagement'
...
...
@@ -277,31 +283,26 @@ def main():
# set current PPOS attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'id'
]
=
G
.
TargetPPOS
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'quantity'
]
=
G
.
TargetPPOSqty
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'targetWeek'
]
=
G
.
TargetPPOSweek
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'id'
]
=
I
G
.
TargetPPOS
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'quantity'
]
=
I
G
.
TargetPPOSqty
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'targetWeek'
]
=
I
G
.
TargetPPOSweek
# set allocation attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxEarliness'
]
=
G
.
maxEarliness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxLateness'
]
=
G
.
maxLateness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'minPackingSize'
]
=
G
.
minPackingSize
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxEarliness'
]
=
I
G
.
maxEarliness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxLateness'
]
=
I
G
.
maxLateness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'minPackingSize'
]
=
I
G
.
minPackingSize
# set capacity attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'capacity'
]
=
G
.
CapacityDict
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'capacity'
]
=
I
G
.
CapacityDict
# set MA attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'MAList'
]
=
G
.
RouteDict
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'MAList'
]
=
I
G
.
RouteDict
G
.
argumentDictString
=
json
.
dumps
(
inputDict
,
indent
=
5
)
argumentDictFile
.
write
(
G
.
argumentDictString
)
# # create the future demand
# FDC=FutureDemandCreator()
# FDC.run()
# #call the AllocManagement routine
# AM = AllocManagement()
# AM.Run()
simulate_line_json
(
input_data
=
(
G
.
argumentDictString
))
# writeOutput() # currently to excel for verification. To be outputted in JSON
...
...
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