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
e4638f49
Commit
e4638f49
authored
Mar 26, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins removed from root plugin folder
parent
77660a60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
109 deletions
+0
-109
dream/plugins/AddDemandPlannerGenerator.py
dream/plugins/AddDemandPlannerGenerator.py
+0
-34
dream/plugins/DemandPlanningLine.py
dream/plugins/DemandPlanningLine.py
+0
-58
dream/plugins/PostProcessDemandPlanning.py
dream/plugins/PostProcessDemandPlanning.py
+0
-17
No files found.
dream/plugins/AddDemandPlannerGenerator.py
deleted
100644 → 0
View file @
77660a60
from
copy
import
copy
import
json
import
time
import
random
import
operator
import
datetime
from
dream.plugins
import
plugin
class
AddDemandPlannerGenerator
(
plugin
.
InputPreparationPlugin
):
""" Input preparation
adds an EventGenerator that will call the Demand Planning algorithm once
"""
def
preprocess
(
self
,
data
):
nodes
=
data
[
'graph'
][
'node'
]
data_uri_encoded_input_data
=
data
[
'input'
].
get
(
self
.
configuration_dict
[
'input_id'
],
{})
algorithmAttributes
=
copy
(
data
[
'general'
])
nodes
[
'DPG'
]
=
{
"name"
:
"DemandPlannerGenerator"
,
"prioritizeIfCanFinish"
:
1
,
"interval"
:
1
,
"start"
:
0
,
"stop"
:
0.5
,
"_class"
:
"dream.simulation.EventGenerator.EventGenerator"
,
"method"
:
"dream.simulation.applications.DemandPlanning.executor_ACO.main"
,
"argumentDict"
:
{
'input'
:
data_uri_encoded_input_data
,
'algorithmAttributes'
:
algorithmAttributes
}
}
#print nodes
return
data
\ No newline at end of file
dream/plugins/DemandPlanningLine.py
deleted
100644 → 0
View file @
77660a60
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
from
datetime
import
datetime
class
DemandPlanningLine
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
""" Output the queue statistics in a format compatible with Output_viewGraph
"""
def
postprocess
(
self
,
data
):
from
dream.simulation.applications.DemandPlanning.Globals
import
G
utilisation
=
G
.
Utilisation
# XXX current implementation for one bottleneck
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'
)
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
]
})
return
data
dream/plugins/PostProcessDemandPlanning.py
deleted
100644 → 0
View file @
77660a60
from
dream.plugins
import
plugin
class
PostProcessDemandPlanning
(
plugin
.
OutputPreparationPlugin
):
""" Output the result of demand planning in a format compatible with
Output_viewDownloadFile
"""
def
postprocess
(
self
,
data
):
# XXX the event generator should store its result in data and not in global
# variable.
from
dream.simulation.applications.DemandPlanning.Globals
import
G
data
[
'result'
][
'result_list'
][
-
1
][
self
.
configuration_dict
[
'output_id'
]]
=
{
'name'
:
'Result.xlsx'
,
'mime_type'
:
'application/vnd.ms-excel'
,
'data'
:
G
.
reportResults
.
xlsx
.
encode
(
'base64'
)
}
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