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
11e9dd32
Commit
11e9dd32
authored
Apr 24, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
module to generate future demand added. Need to identify some better description for Jobs. Maybe MA
parent
a57ddd23
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
4 deletions
+92
-4
dream/simulation/FutureDemandCreator.py
dream/simulation/FutureDemandCreator.py
+85
-0
dream/simulation/GUI/DemandPlanning.py
dream/simulation/GUI/DemandPlanning.py
+7
-4
No files found.
dream/simulation/FutureDemandCreator.py
0 → 100644
View file @
11e9dd32
'''
Created on 3 Oct 2013
@author: Anna
'''
import
xlrd
import
json
from
Globals
import
G
class
FutureDemandCreator
():
def
run
(
self
):
#create new buffers
G
.
Buffer
.
append
([])
G
.
ExcessFutureBuffer
.
append
([])
G
.
ExcessFutureMinBuffer
.
append
([])
G
.
ExcessPPOSBuffer
.
append
([])
G
.
ExcessPPOSminBuffer
.
append
([])
# create output lists
G
.
AllocationFuture
.
append
([])
G
.
FutureLateness
.
append
(
0
)
G
.
FutureEarliness
.
append
(
0
)
G
.
AllocationPPOS
.
append
([])
G
.
PPOSLateness
.
append
(
0
)
G
.
PPOSEarliness
.
append
(
0
)
G
.
Capacity
=
[]
wbin
=
xlrd
.
open_workbook
(
'GUI/inputs.xlsx'
)
sh
=
wbin
.
sheet_by_name
(
'Capacity'
)
nCols
=
sh
.
ncols
assert
(
nCols
==
G
.
planningHorizon
+
1
)
capacity
=
[]
for
i
in
range
(
1
,
nCols
):
capacity
.
append
(
sh
.
col_values
(
i
,
2
))
G
.
Capacity
=
capacity
G
.
currentCapacity
=
G
.
Capacity
# PPOS initial disaggregation profile
G
.
demandFile
=
'GUI/DemandProfile.xlsx'
wbin
=
xlrd
.
open_workbook
(
G
.
demandFile
)
MAData
=
json
.
loads
(
G
.
argumentDictString
)[
'argumentDict'
][
'MAList'
]
for
k
in
range
(
2
):
if
k
==
0
:
#sh = wbin.sheet_by_name('PPOS_Profile')
sh
=
wbin
.
sheet_by_name
(
'PPOS'
)
fut
=
0
pProf
=
[]
else
:
#sh = wbin.sheet_by_name('Future_Profile')
sh
=
wbin
.
sheet_by_name
(
'Future'
+
str
(
G
.
replication
+
1
))
fut
=
1
fProf
=
[]
nRows
=
sh
.
nrows
for
i
in
range
(
1
,
nRows
):
order
=
int
(
sh
.
cell_value
(
i
,
0
))
-
1
MA
=
sh
.
cell_value
(
i
,
1
)
# -1 in order to start from 0
orderQty
=
float
(
sh
.
cell_value
(
i
,
2
))
orderMinQty
=
float
(
sh
.
cell_value
(
i
,
3
))
week
=
int
(
sh
.
cell_value
(
i
,
4
))
-
1
if
k
==
0
:
pProf
.
append
([
order
+
1
,
MA
,
orderQty
,
orderMinQty
,
week
+
1
])
elif
k
==
1
:
fProf
.
append
([
order
+
1
,
MA
,
orderQty
,
orderMinQty
,
week
+
1
])
SP
=
MAData
[
str
(
MA
)][
'SP'
]
PPOS
=
MAData
[
str
(
MA
)][
'PPOS'
]
print
SP
,
PPOS
# create item
newItem
=
Job
(
orderID
=
order
,
MAid
=
MA
,
SPid
=
SP
,
PPOSid
=
PPOS
,
qty
=
orderQty
,
minQty
=
orderMinQty
,
origWeek
=
week
,
future
=
fut
)
G
.
Buffer
[
G
.
replication
].
append
(
newItem
)
if
k
==
0
:
G
.
PPOSprofile
.
append
(
pProf
)
else
:
G
.
FutureProfile
.
append
(
fProf
)
dream/simulation/GUI/DemandPlanning.py
View file @
11e9dd32
...
...
@@ -28,7 +28,8 @@ test script to convert the static excels to JSON. It does not communicate with G
import
xlwt
import
xlrd
import
json
from
dream
.
simulation
.
Globals
import
G
from
dream.simulation.Globals
import
G
from
dream.simulation.FutureDemandCreator
import
FutureDemandCreator
def
createGlobals
():
G
.
TargetPPOS
=
0
...
...
@@ -145,10 +146,12 @@ def main():
argumentDict
[
'argumentDict'
][
'capacity'
]
=
G
.
CapacityDict
# set MA attributes
argumentDict
[
'argumentDict'
][
'MA'
]
=
G
.
RouteDict
argumentDict
[
'argumentDict'
][
'MA
List
'
]
=
G
.
RouteDict
argumentDictString
=
json
.
dumps
(
argumentDict
,
indent
=
5
)
argumentDictFile
.
write
(
argumentDictString
)
G
.
argumentDictString
=
json
.
dumps
(
argumentDict
,
indent
=
5
)
argumentDictFile
.
write
(
G
.
argumentDictString
)
# FDC=FutureDemandCreator()
# FDC.run()
if
__name__
==
'__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