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
7d44f9b3
Commit
7d44f9b3
authored
Jan 16, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor bugs in shift and skills plugins corrected
parent
fc946a94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
dream/plugins/ReadShiftFromSpreadsheet.py
dream/plugins/ReadShiftFromSpreadsheet.py
+13
-12
dream/plugins/ReadSkilledOperators.py
dream/plugins/ReadSkilledOperators.py
+14
-11
No files found.
dream/plugins/ReadShiftFromSpreadsheet.py
View file @
7d44f9b3
...
...
@@ -31,18 +31,19 @@ class ReadShiftFromSpreadsheet(plugin.InputPreparationPlugin):
shift_by_station
.
setdefault
(
station
,
[]).
append
(
(
start_time
,
stop_time
)
)
for
line
in
data
[
'input'
][
'operator_shift_spreadsheet'
][
1
:]:
if
line
[
1
]:
# Get the dates, and convert them to simulation clock time units.
# In this class, time unit is a minute (XXX it can be an option)
start_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
2
]),
'%Y/%m/%d %H:%M'
)
start_time
=
(
start_date
-
now
).
total_seconds
()
//
60
stop_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
3
]),
'%Y/%m/%d %H:%M'
)
stop_time
=
(
stop_date
-
now
).
total_seconds
()
//
60
for
station
in
line
[
1
].
split
(
','
):
station
=
station
.
strip
()
shift_by_station
.
setdefault
(
station
,
[]).
append
(
(
start_time
,
stop_time
)
)
if
data
[
'input'
][
'operator_shift_spreadsheet'
]:
for
line
in
data
[
'input'
][
'operator_shift_spreadsheet'
][
1
:]:
if
line
[
1
]:
# Get the dates, and convert them to simulation clock time units.
# In this class, time unit is a minute (XXX it can be an option)
start_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
2
]),
'%Y/%m/%d %H:%M'
)
start_time
=
(
start_date
-
now
).
total_seconds
()
//
60
stop_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
3
]),
'%Y/%m/%d %H:%M'
)
stop_time
=
(
stop_date
-
now
).
total_seconds
()
//
60
for
station
in
line
[
1
].
split
(
','
):
station
=
station
.
strip
()
shift_by_station
.
setdefault
(
station
,
[]).
append
(
(
start_time
,
stop_time
)
)
for
node
,
node_data
in
data
[
'graph'
][
'node'
].
items
():
if
node
in
shift_by_station
:
...
...
dream/plugins/ReadSkilledOperators.py
View file @
7d44f9b3
...
...
@@ -17,6 +17,7 @@ class ReadSkilledOperators(plugin.InputPreparationPlugin):
"""
PBData
=
data
[
'input'
].
get
(
'operator_skill_spreadsheet'
,
None
)
node
=
data
[
'graph'
][
'node'
]
operatorPresent
=
False
if
PBData
:
PBData
.
pop
(
0
)
# pop the column names
for
PBitem
in
PBData
:
...
...
@@ -32,21 +33,23 @@ class ReadSkilledOperators(plugin.InputPreparationPlugin):
"skills"
:
skills
,
"ouputSchedule"
:
1
}
operatorPresent
=
True
# 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"
}
if
operatorPresent
:
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 '---------------------------------'
...
...
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