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
Hide 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
...
@@ -31,13 +31,19 @@ import json
from
AllocManagement
import
AllocManagement
from
AllocManagement
import
AllocManagement
from
dream.simulation.LineGenerationJSON
import
main
as
simulate_line_json
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
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
():
def
createGlobals
():
G
.
TargetPPOS
=
0
G
.
TargetPPOSqty
=
0
G
.
TargetPPOSweek
=
0
G
.
ReplicationNo
=
0
G
.
ReplicationNo
=
0
G
.
replication
=
0
G
.
replication
=
0
G
.
PPOSlist
=
{}
G
.
PPOSlist
=
{}
...
@@ -64,8 +70,7 @@ def createGlobals():
...
@@ -64,8 +70,7 @@ def createGlobals():
G
.
ExcessFutureBuffer
=
[]
G
.
ExcessFutureBuffer
=
[]
G
.
ExcessFutureMinBuffer
=
[]
G
.
ExcessFutureMinBuffer
=
[]
G
.
DistributionType
=
None
G
.
DistributionType
=
None
G
.
CapacityDict
=
{}
G
.
RouteDict
=
{}
# filterItem = 0
# filterItem = 0
# filterWeek = 0
# filterWeek = 0
...
@@ -77,14 +82,14 @@ def readGeneralInput():
...
@@ -77,14 +82,14 @@ def readGeneralInput():
# general simulation input
# general simulation input
wbin
=
xlrd
.
open_workbook
(
'GUI/inputs.xlsx'
)
wbin
=
xlrd
.
open_workbook
(
'GUI/inputs.xlsx'
)
sh
=
wbin
.
sheet_by_name
(
'Scalar_Var'
)
sh
=
wbin
.
sheet_by_name
(
'Scalar_Var'
)
G
.
TargetPPOS
=
int
(
sh
.
cell
(
2
,
1
).
value
)
-
1
I
G
.
TargetPPOS
=
int
(
sh
.
cell
(
2
,
1
).
value
)
-
1
G
.
TargetPPOSqty
=
int
(
sh
.
cell
(
3
,
1
).
value
)
I
G
.
TargetPPOSqty
=
int
(
sh
.
cell
(
3
,
1
).
value
)
G
.
TargetPPOSweek
=
int
(
sh
.
cell
(
6
,
1
).
value
)
-
1
I
G
.
TargetPPOSweek
=
int
(
sh
.
cell
(
6
,
1
).
value
)
-
1
G
.
planningHorizon
=
int
(
sh
.
cell
(
7
,
1
).
value
)
G
.
planningHorizon
=
int
(
sh
.
cell
(
7
,
1
).
value
)
G
.
ReplicationNo
=
int
(
sh
.
cell
(
15
,
1
).
value
)
G
.
ReplicationNo
=
int
(
sh
.
cell
(
15
,
1
).
value
)
G
.
maxEarliness
=
int
(
sh
.
cell
(
18
,
1
).
value
)
I
G
.
maxEarliness
=
int
(
sh
.
cell
(
18
,
1
).
value
)
G
.
maxLateness
=
int
(
sh
.
cell
(
19
,
1
).
value
)
I
G
.
maxLateness
=
int
(
sh
.
cell
(
19
,
1
).
value
)
G
.
minPackingSize
=
int
(
sh
.
cell
(
22
,
1
).
value
)
I
G
.
minPackingSize
=
int
(
sh
.
cell
(
22
,
1
).
value
)
# capacity information
# capacity information
sh
=
wbin
.
sheet_by_name
(
'Capacity'
)
sh
=
wbin
.
sheet_by_name
(
'Capacity'
)
...
@@ -105,7 +110,7 @@ def readGeneralInput():
...
@@ -105,7 +110,7 @@ def readGeneralInput():
nCols
=
sh
.
ncols
nCols
=
sh
.
ncols
# prepare a dict that holds the capacity of every bottleneck per week
# prepare a dict that holds the capacity of every bottleneck per week
for
i
in
range
(
3
,
nCols
):
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
):
for
i
in
range
(
4
,
nRows
):
...
@@ -114,9 +119,9 @@ def readGeneralInput():
...
@@ -114,9 +119,9 @@ def readGeneralInput():
ppos
=
tempPPOSlist
[
0
]
ppos
=
tempPPOSlist
[
0
]
sp
=
tempPPOSlist
[
1
]
sp
=
tempPPOSlist
[
1
]
routeValues
=
sh
.
row_values
(
i
,
3
,
nCols
)
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
)):
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
():
def
writeOutput
():
...
@@ -268,6 +273,7 @@ def main():
...
@@ -268,6 +273,7 @@ def main():
inputDict
[
'general'
][
'numberOfReplications'
]
=
G
.
ReplicationNo
inputDict
[
'general'
][
'numberOfReplications'
]
=
G
.
ReplicationNo
inputDict
[
'general'
][
'_class'
]
=
'Dream.Simulation'
inputDict
[
'general'
][
'_class'
]
=
'Dream.Simulation'
inputDict
[
'edges'
]
=
{}
inputDict
[
'nodes'
]
=
{}
inputDict
[
'nodes'
]
=
{}
inputDict
[
'nodes'
][
'AM'
]
=
{}
inputDict
[
'nodes'
][
'AM'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'_class'
]
=
'Dream.AllocationManagement'
inputDict
[
'nodes'
][
'AM'
][
'_class'
]
=
'Dream.AllocationManagement'
...
@@ -277,31 +283,26 @@ def main():
...
@@ -277,31 +283,26 @@ def main():
# set current PPOS attributes
# set current PPOS attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'id'
]
=
G
.
TargetPPOS
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'id'
]
=
I
G
.
TargetPPOS
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'quantity'
]
=
G
.
TargetPPOSqty
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'quantity'
]
=
I
G
.
TargetPPOSqty
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'targetWeek'
]
=
G
.
TargetPPOSweek
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'currentPPOS'
][
'targetWeek'
]
=
I
G
.
TargetPPOSweek
# set allocation attributes
# set allocation attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
]
=
{}
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxEarliness'
]
=
G
.
maxEarliness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxEarliness'
]
=
I
G
.
maxEarliness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxLateness'
]
=
G
.
maxLateness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'maxLateness'
]
=
I
G
.
maxLateness
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'minPackingSize'
]
=
G
.
minPackingSize
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'allocationData'
][
'minPackingSize'
]
=
I
G
.
minPackingSize
# set capacity attributes
# set capacity attributes
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'capacity'
]
=
G
.
CapacityDict
inputDict
[
'nodes'
][
'AM'
][
'argumentDict'
][
'capacity'
]
=
I
G
.
CapacityDict
# set MA attributes
# 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
)
G
.
argumentDictString
=
json
.
dumps
(
inputDict
,
indent
=
5
)
argumentDictFile
.
write
(
G
.
argumentDictString
)
argumentDictFile
.
write
(
G
.
argumentDictString
)
# # create the future demand
simulate_line_json
(
input_data
=
(
G
.
argumentDictString
))
# FDC=FutureDemandCreator()
# FDC.run()
# #call the AllocManagement routine
# AM = AllocManagement()
# AM.Run()
# writeOutput() # currently to excel for verification. To be outputted in JSON
# 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