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
7a73f85c
Commit
7a73f85c
authored
Jan 12, 2015
by
Georgios Dagkakis
Committed by
Ioannis Papagiannopoulos
Jan 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Batch instance to read operators
parent
9d969232
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
dream/plugins/ReadSkilledOperators.py
dream/plugins/ReadSkilledOperators.py
+53
-0
dream/simulation/Examples/BatchAllInOneEmpty.json
dream/simulation/Examples/BatchAllInOneEmpty.json
+4
-0
No files found.
dream/plugins/ReadSkilledOperators.py
0 → 100644
View file @
7a73f85c
from
copy
import
copy
import
json
import
time
import
random
import
operator
from
datetime
import
datetime
from
dream.plugins
import
plugin
class
ReadSkilledOperators
(
plugin
.
InputPreparationPlugin
):
""" Input prepration
reads the operators and their skills from the spreadsheet and adds them to the model
"""
def
preprocess
(
self
,
data
):
""" Set the WIP in queue from spreadsheet data.
"""
PBData
=
data
[
'input'
].
get
(
'operator_skill_spreadsheet'
,
None
)
node
=
data
[
'graph'
][
'node'
]
if
PBData
:
PBData
.
pop
(
0
)
# pop the column names
for
PBitem
in
PBData
:
PBId
=
PBitem
[
0
]
# in case there is no id, do not process the element
if
not
PBId
:
continue
skills
=
PBitem
[
1
].
split
(
','
)
node
[
PBId
]
=
{
"_class"
:
"Dream.Operator"
,
"capacity"
:
1
,
"name"
:
PBId
,
"skills"
:
skills
}
# for every station that has one or more skilled operators set operation type to MT-Load-Processing
for
stationId
in
skills
:
node
[
stationId
][
"operationType"
]
=
"MT-Load-Processing"
# add EventGenerator for the allocation every 10 minutes
node
[
'EV123454321'
]
=
{
#(random id)
"name"
:
"Allocator"
,
"argumentDict"
:
"{}"
,
"interval"
:
10
,
"stop"
:
-
1
,
"id"
:
"EV123454321"
,
"start"
:
0
,
"interruptions"
:
{},
"_class"
:
"Dream.EventGenerator"
,
"method"
:
"Dream.ManPyObject.requestAllocation"
}
# print '---------------------------------'
# print data['graph']['node']
# print '---------------------------------'
return
data
dream/simulation/Examples/BatchAllInOneEmpty.json
View file @
7a73f85c
...
...
@@ -838,6 +838,10 @@
},
{
"plugin"
:
"BatchesWIPSpreadsheet.BatchesWIPSpreadsheet"
,
"input_id"
:
"WipSpreadsheet"
},
{
"plugin"
:
"ReadSkilledOperators.ReadSkilledOperators"
,
"input_id"
:
"SkilledOperatorsSpreadsheet"
}
]
},
...
...
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