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
a54ea05d
Commit
a54ea05d
authored
May 27, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin to postprocess demand planning bottleneck analysis by week
parent
c86ca019
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
dream/plugins/DemandPlanning/DemandPlanningLine.py
dream/plugins/DemandPlanning/DemandPlanningLine.py
+57
-0
No files found.
dream/plugins/DemandPlanning/DemandPlanningLine.py
View file @
a54ea05d
...
...
@@ -62,3 +62,60 @@ class DemandPlanningLine(plugin.OutputPreparationPlugin, TimeSupportMixin):
})
return
data
class
BottleNeckByWeek
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
""" Output the queue statistics in a format compatible with Output_viewGraph, for the second widget by week.
"""
def
postprocess
(
self
,
data
):
from
dream.simulation.applications.DemandPlanning.Globals
import
G
result
=
data
[
'result'
][
'result_list'
][
-
1
]
bottleNeckUtilizationDict
=
result
[
'bottleneck_utilization_by_week'
]
=
{}
by_week
=
{}
# change {bottleneck: {week: data }} in {week: {bottleneck: data}}
for
bottleneck
,
bottleNeckUtilization
in
G
.
Utilisation
.
iteritems
():
for
record_id
,
record
in
bottleNeckUtilization
.
iteritems
():
by_week
.
setdefault
(
record_id
,
{})[
bottleneck
]
=
record
for
week
,
bottleneckData
in
by_week
.
items
():
series
=
[]
ticks
=
[
list
(
enumerate
(
bottleneckData
.
keys
()))]
options
=
{
"xaxis"
:
{
"minTickSize"
:
1
,
"ticks"
:
ticks
},
"series"
:
{
"bars"
:
{
"show"
:
True
,
"barWidth"
:
0.10
,
"order"
:
1
,
"align"
:
"center"
},
"stack"
:
False
}
}
weekLabel
=
"%s %s"
%
(
str
(
week
)[:
4
],
str
(
week
)[
4
:])
bottleNeckUtilizationDict
[
weekLabel
]
=
{
"series"
:
series
,
"options"
:
options
}
# create the 3 bars
for
(
utilizationType
,
utilizationLabel
)
in
[
(
'averageUtilization'
,
'Average Utilization'
),
(
'minUtilization'
,
'Min Utilization'
),
(
'maxUtilization'
,
'Max Utilization'
)
]:
series
.
append
({
"label"
:
utilizationLabel
,
"data"
:
list
(
enumerate
([
x
[
utilizationType
]
for
x
in
bottleneckData
.
values
()])),
})
return
data
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