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
7c768330
Commit
7c768330
authored
Mar 02, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instance and plugin updated to output 2 lines
parent
93b606e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
41 deletions
+57
-41
dream/plugins/DemandPlanningLine.py
dream/plugins/DemandPlanningLine.py
+39
-37
dream/simulation/Examples/GUI_instances/DemandPlanningAllInOneEmpty.json
...n/Examples/GUI_instances/DemandPlanningAllInOneEmpty.json
+18
-4
No files found.
dream/plugins/DemandPlanningLine.py
View file @
7c768330
...
...
@@ -11,46 +11,48 @@ class DemandPlanningLine(plugin.OutputPreparationPlugin, TimeSupportMixin):
from
dream.simulation.applications.DemandPlanning.Globals
import
G
utilisation
=
G
.
Utilisation
# XXX current implementation for one bottleneck
bottleNeckUtilization
=
G
.
Utilisation
[
'BE_T_BE1S_TEST_EQ_FLEX_T417_3'
]
dateList
=
[]
# get the current date from the data
for
record_id
,
record
in
bottleNeckUtilization
.
iteritems
():
year
=
str
(
record_id
)[
0
:
4
]
week
=
str
(
record_id
)[
4
:]
fullDate
=
datetime
.
strptime
(
year
+
'-'
+
week
+
'-0'
,
'%Y-%W-%w'
)
dateList
.
append
(
fullDate
)
currentDate
=
str
(
min
(
dateList
))
currentDate
=
currentDate
.
replace
(
'-'
,
'/'
)
data
[
'general'
][
'currentDate'
]
=
currentDate
data
[
'general'
][
'timeUnit'
]
=
'week'
self
.
initializeTimeSupport
(
data
)
result
=
data
[
'result'
][
'result_list'
][
-
1
]
series
=
[]
options
=
{
"xaxis"
:
{
"mode"
:
"time"
,
"minTickSize"
:
[
1
,
self
.
getTimeUnitText
()],
}
}
result
[
self
.
configuration_dict
[
'output_id'
]]
=
{
"series"
:
series
,
"options"
:
options
}
# create the 3 lines
for
utilizationType
in
[
'averageUtilization'
,
'minUtilization'
,
'maxUtilization'
]:
utilizationList
=
[]
for
bottleneck
in
[
'BE_A_VF78_DSO_3'
,
'BE_A_VK18_DKO_5'
]:
bottleNeckUtilization
=
G
.
Utilisation
[
bottleneck
]
dateList
=
[]
# get the current date from the data
for
record_id
,
record
in
bottleNeckUtilization
.
iteritems
():
year
=
str
(
record_id
)[
0
:
4
]
week
=
str
(
record_id
)[
4
:]
fullDate
=
datetime
.
strptime
(
year
+
'-'
+
week
+
'-0'
,
'%Y-%W-%w'
)
utilizationList
.
append
([
fullDate
,
record
[
utilizationType
]])
dateList
.
append
(
fullDate
)
currentDate
=
str
(
min
(
dateList
))
currentDate
=
currentDate
.
replace
(
'-'
,
'/'
)
data
[
'general'
][
'currentDate'
]
=
currentDate
data
[
'general'
][
'timeUnit'
]
=
'week'
self
.
initializeTimeSupport
(
data
)
result
=
data
[
'result'
][
'result_list'
][
-
1
]
series
=
[]
options
=
{
"xaxis"
:
{
"mode"
:
"time"
,
"minTickSize"
:
[
1
,
self
.
getTimeUnitText
()],
}
}
result
[
bottleneck
]
=
{
"series"
:
series
,
"options"
:
options
}
# create the 3 lines
for
utilizationType
in
[
'averageUtilization'
,
'minUtilization'
,
'maxUtilization'
]:
utilizationList
=
[]
for
record_id
,
record
in
bottleNeckUtilization
.
iteritems
():
year
=
str
(
record_id
)[
0
:
4
]
week
=
str
(
record_id
)[
4
:]
fullDate
=
datetime
.
strptime
(
year
+
'-'
+
week
+
'-0'
,
'%Y-%W-%w'
)
utilizationList
.
append
([
fullDate
,
record
[
utilizationType
]])
utilizationList
.
sort
(
key
=
lambda
x
:
x
[
0
],
reverse
=
True
)
series
.
append
({
"label"
:
utilizationType
,
"data"
:
[((
time
-
datetime
(
1970
,
1
,
1
)).
total_seconds
()
*
1000
,
value
)
for
(
time
,
value
)
in
utilizationList
]
})
utilizationList
.
sort
(
key
=
lambda
x
:
x
[
0
],
reverse
=
True
)
series
.
append
({
"label"
:
utilizationType
,
"data"
:
[((
time
-
datetime
(
1970
,
1
,
1
)).
total_seconds
()
*
1000
,
value
)
for
(
time
,
value
)
in
utilizationList
]
})
return
data
dream/simulation/Examples/GUI_instances/DemandPlanningAllInOneEmpty.json
View file @
7c768330
...
...
@@ -62,6 +62,12 @@
"name"
:
"Minimum Delta Utilisation"
,
"type"
:
"number"
},
"MAProportionality"
:
{
"default"
:
0.5
,
"description"
:
"Mutation Proportionality"
,
"name"
:
"Mutation Proportionality"
,
"type"
:
"number"
},
"GA"
:
{
"default"
:
1
,
"description"
:
"GA"
,
...
...
@@ -142,14 +148,22 @@
"title"
:
"Download Result Spreadsheet"
,
"type"
:
"object_view"
},
"view_utilization_stats"
:
{
"view_utilization_stats
1
"
:
{
"configuration"
:
{
"output_id"
:
"bottleneck_utilization"
"output_id"
:
"BE_A_VF78_DSO_3"
},
"gadget"
:
"Output_viewGraph"
,
"title"
:
"BE_A_VF78_DSO_3 Utilization"
,
"type"
:
"object_view"
},
"view_utilization_stats2"
:
{
"configuration"
:
{
"output_id"
:
"BE_A_VK18_DKO_5"
},
"gadget"
:
"Output_viewGraph"
,
"title"
:
"B
ottleneck
Utilization"
,
"title"
:
"B
E_A_VK18_DKO_5
Utilization"
,
"type"
:
"object_view"
}
}
},
"post_processing"
:
{
"plugin_list"
:
[
...
...
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