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
cd335b24
Commit
cd335b24
authored
May 07, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some corrections. Now output of 2 approaches seems to coincide. More verification needed
parent
7b3b9562
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
dream/simulation/GUI/Allocation.py
dream/simulation/GUI/Allocation.py
+2
-2
dream/simulation/GUI/DemandPlanning.py
dream/simulation/GUI/DemandPlanning.py
+6
-6
No files found.
dream/simulation/GUI/Allocation.py
View file @
cd335b24
...
...
@@ -183,11 +183,11 @@ class Allocation():
# update allocation output variable
# distinguish case of FutureDemand from PPOSdemand
if
MA
.
future
==
1
:
G
.
AllocationFuture
[
G
.
replication
].
append
([
MA
.
orderID
,
alternativeMADict
[
chosenMAId
]
,
allocableQty
,
self
.
week
+
1
])
G
.
AllocationFuture
[
G
.
replication
].
append
([
MA
.
orderID
,
chosenMAId
,
allocableQty
,
self
.
week
+
1
])
G
.
FutureLateness
[
G
.
replication
]
+=
max
([
0
,
self
.
week
-
MA
.
originalWeek
])
*
allocableQty
G
.
FutureEarliness
[
G
.
replication
]
+=
max
([
0
,
MA
.
originalWeek
-
self
.
week
])
*
allocableQty
else
:
G
.
AllocationPPOS
[
G
.
replication
].
append
([
MA
.
orderID
,
alternativeMADict
[
chosenMAId
]
,
allocableQty
,
self
.
week
+
1
])
G
.
AllocationPPOS
[
G
.
replication
].
append
([
MA
.
orderID
,
chosenMAId
,
allocableQty
,
self
.
week
+
1
])
G
.
PPOSLateness
[
G
.
replication
]
+=
max
([
0
,
self
.
week
-
MA
.
originalWeek
])
*
allocableQty
G
.
PPOSEarliness
[
G
.
replication
]
+=
max
([
0
,
MA
.
originalWeek
-
self
.
week
])
*
allocableQty
...
...
dream/simulation/GUI/DemandPlanning.py
View file @
cd335b24
...
...
@@ -190,10 +190,10 @@ def writeOutput():
print
'allocation'
,
alloc
counterCols
=
[
5
for
i
in
range
(
len
(
profile
))]
# TODO the below crashes, got to check
#
for i in range(len(alloc)):
#
for j in range(3):
#
sheet.write(alloc[i][0]+2,counterCols[alloc[i][0]]+j,alloc[i][j+1])
#
counterCols[alloc[i][0]] += 3
for
i
in
range
(
len
(
alloc
)):
for
j
in
range
(
3
):
sheet
.
write
(
alloc
[
i
][
0
]
+
2
,
counterCols
[
alloc
[
i
][
0
]]
+
j
,
alloc
[
i
][
j
+
1
])
counterCols
[
alloc
[
i
][
0
]]
+=
3
attempts
=
(
max
(
counterCols
)
-
5
)
/
3
for
i
in
range
(
attempts
):
...
...
@@ -229,7 +229,7 @@ def writeOutput():
sheet
.
write
(
0
,
2
,
'excess Units'
)
for
i
in
buf
:
sheet
.
write
(
row
,
0
,
i
.
orderID
+
1
)
sheet
.
write
(
row
,
1
,
i
.
MAid
+
1
)
sheet
.
write
(
row
,
1
,
i
.
MAid
)
sheet
.
write
(
row
,
2
,
i
.
qty
)
row
+=
1
...
...
@@ -241,7 +241,6 @@ def writeOutput():
sheet
.
write_merge
(
0
,
1
,
0
,
0
,
'Bottlenecks'
)
i
=
2
for
record
in
G
.
CurrentCapacityDict
:
print
record
,
G
.
CurrentCapacityDict
[
record
]
sheet
.
write
(
i
,
0
,
record
)
sheet
.
write
(
i
,
1
,
G
.
CurrentCapacityDict
[
record
][
0
])
sheet
.
write
(
i
,
2
,
G
.
CurrentCapacityDict
[
record
][
1
])
...
...
@@ -294,6 +293,7 @@ def main():
AM
=
AllocManagement
()
AM
.
Run
()
writeOutput
()
# currently to excel for verification. To be outputted in JSON
print
G
.
AllocationPPOS
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