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
37e0ee5c
Commit
37e0ee5c
authored
Jun 30, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new version in ImportInput
parent
aa1877e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
dream/simulation/applications/DemandPlanning/ImportInput.py
dream/simulation/applications/DemandPlanning/ImportInput.py
+19
-14
No files found.
dream/simulation/applications/DemandPlanning/ImportInput.py
View file @
37e0ee5c
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
'''
'''
Created on 24 Nov 2014
Created on 24 Nov 2014
@author: Anna
@author: Anna
'''
'''
from
Globals
import
G
from
Globals
import
G
import
xlrd
import
xlrd
from
copy
import
deepcopy
def
withoutFormat
(
row
,
col
,
sheet
,
integer
):
def
withoutFormat
(
row
,
col
,
sheet
,
integer
):
...
@@ -181,6 +181,7 @@ def ImportInput(input, algorithmAttributes):
...
@@ -181,6 +181,7 @@ def ImportInput(input, algorithmAttributes):
G
.
sortedOrders
[
'order'
][
priority
][
week
].
append
(
G
.
orders
[
orderID
])
G
.
sortedOrders
[
'order'
][
priority
][
week
].
append
(
G
.
orders
[
orderID
])
orderID
+=
1
orderID
+=
1
print
'sorted orders keys'
,
G
.
sortedOrders
[
'order'
].
keys
()
# Import forecast
# Import forecast
sh
=
wbin
.
sheet_by_name
(
'FC_Summary'
)
sh
=
wbin
.
sheet_by_name
(
'FC_Summary'
)
rows
=
sh
.
nrows
rows
=
sh
.
nrows
...
@@ -238,15 +239,27 @@ def ImportInput(input, algorithmAttributes):
...
@@ -238,15 +239,27 @@ def ImportInput(input, algorithmAttributes):
# set
# set
for
sp
in
G
.
SPlist
.
keys
():
for
sp
in
G
.
SPlist
.
keys
():
G
.
globalMAAllocationIW
[
sp
]
=
{}
for
week
in
G
.
WeekList
:
G
.
globalMAAllocationIW
[
sp
][
week
]
=
{
'order'
:{},
'forecast'
:{}}
for
priority
in
G
.
priorityList
[
'order'
]:
G
.
globalMAAllocationIW
[
sp
][
week
][
'order'
][
priority
]
=
0
for
priority
in
G
.
priorityList
[
'forecast'
]:
G
.
globalMAAllocationIW
[
sp
][
week
][
'forecast'
][
priority
]
=
0
for
ma
in
G
.
SPlist
[
sp
]:
for
ma
in
G
.
SPlist
[
sp
]:
G
.
globalMAAllocation
[
ma
]
=
{}
G
.
globalMAAllocation
[
ma
]
=
{}
G
.
globalMAAllocationIW
[
ma
]
=
{}
for
week
in
G
.
WeekList
:
for
week
in
G
.
WeekList
:
G
.
globalMAAllocation
[
ma
][
week
]
=
{
'order'
:{}}
G
.
globalMAAllocation
[
ma
][
week
]
=
{
'order'
:{}}
G
.
globalMAAllocationIW
[
ma
][
week
]
=
{
'order'
:{}}
for
priority
in
G
.
priorityList
[
'order'
]:
for
priority
in
G
.
priorityList
[
'order'
]:
G
.
globalMAAllocation
[
ma
][
week
][
'order'
][
priority
]
=
0
G
.
globalMAAllocation
[
ma
][
week
][
'order'
][
priority
]
=
0
G
.
globalMAAllocationIW
[
ma
][
week
][
'order'
][
priority
]
=
0
G
.
globalMAAllocation
[
ma
][
week
][
'forecast'
]
=
{}
G
.
globalMAAllocation
[
ma
][
week
][
'forecast'
]
=
{}
G
.
globalMAAllocationIW
[
ma
][
week
][
'forecast'
]
=
{}
for
priority
in
G
.
priorityList
[
'forecast'
]:
for
priority
in
G
.
priorityList
[
'forecast'
]:
G
.
globalMAAllocation
[
ma
][
week
][
'forecast'
][
priority
]
=
0
G
.
globalMAAllocation
[
ma
][
week
][
'forecast'
][
priority
]
=
0
G
.
globalMAAllocationIW
[
ma
][
week
][
'forecast'
][
priority
]
=
0
# set lateness and earliness results
# set lateness and earliness results
for
week
in
G
.
WeekList
:
for
week
in
G
.
WeekList
:
...
@@ -263,17 +276,9 @@ def ImportInput(input, algorithmAttributes):
...
@@ -263,17 +276,9 @@ def ImportInput(input, algorithmAttributes):
for
week
in
G
.
WeekList
:
for
week
in
G
.
WeekList
:
G
.
Excess
[
sp
][
week
]
=
0
G
.
Excess
[
sp
][
week
]
=
0
G
.
ordersOrig
=
deepcopy
(
G
.
orders
)
G
.
sortedOrdersOrig
=
deepcopy
(
G
.
sortedOrders
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
ImportInput
()
ImportInput
()
\ No newline at end of file
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