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
560b3624
Commit
560b3624
authored
May 12, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin to take a deterministic model and set distributions to triangular added
parent
e3aa02cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
dream/plugins/SetTriangular.py
dream/plugins/SetTriangular.py
+33
-0
No files found.
dream/plugins/SetTriangular.py
0 → 100644
View file @
560b3624
from
copy
import
copy
import
json
import
time
import
random
import
operator
from
datetime
import
datetime
from
dream.plugins
import
plugin
# XXX HARDCODED
MACHINE_TYPE_SET
=
set
([
"Dream.MachineJobShop"
,
"Dream.MouldAssembly"
,
"Dream.Machine"
,
"Dream.BatchScrapMachine"
])
class
SetTriangular
(
plugin
.
InputPreparationPlugin
):
""" Input preparation
takes a model with deterministic processing time and sets it to triangular
"""
def
preprocess
(
self
,
data
):
nodes
=
data
[
'graph'
][
'node'
]
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
.
get
(
'_class'
,
None
)
==
self
.
configuration_dict
[
'input_id'
]:
processingTime
=
node
.
get
(
'processingTime'
,{})
distribution
=
processingTime
.
get
(
"Fixed"
,{})
if
distribution
:
mean
=
distribution
[
'mean'
]
processingTime
.
pop
(
'Fixed'
,
None
)
processingTime
[
'Triangular'
]
=
{
"mean"
:
mean
,
"min"
:
0.8
*
mean
,
"max"
:
1.2
*
mean
}
return
data
\ 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