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
23b19465
Commit
23b19465
authored
Feb 21, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batches utilization of stations to count the reassembly blocakge
parent
458622cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
dream/plugins/BatchesStationUtilization.py
dream/plugins/BatchesStationUtilization.py
+27
-10
No files found.
dream/plugins/BatchesStationUtilization.py
View file @
23b19465
from
dream.plugins
import
plugin
from
copy
import
copy
class
BatchesStationUtilization
(
plugin
.
OutputPreparationPlugin
):
""" Output the station utilization metrics in a format compatible with
...
...
@@ -58,16 +59,32 @@ class BatchesStationUtilization(plugin.OutputPreparationPlugin):
i
=
0
for
obj
in
result
[
'elementList'
]:
if
obj
.
get
(
'_class'
).
startswith
(
'Dream.BatchScrapMachine'
)
or
obj
.
get
(
'_class'
)
==
'Dream.M3'
:
if
obj
[
'results'
][
'working_ratio'
]:
working_data
.
append
((
i
,
obj
[
'results'
][
'working_ratio'
][
0
]))
if
obj
[
'results'
][
'waiting_ratio'
]:
waiting_data
.
append
((
i
,
obj
[
'results'
][
'waiting_ratio'
][
0
]))
if
obj
[
'results'
][
'failure_ratio'
]:
failure_data
.
append
((
i
,
obj
[
'results'
][
'failure_ratio'
][
0
]))
if
obj
[
'results'
][
'blockage_ratio'
]:
blockage_data
.
append
((
i
,
obj
[
'results'
][
'blockage_ratio'
][
0
]))
if
obj
[
'results'
][
'off_shift_ratio'
]:
off_shift_data
.
append
((
i
,
obj
[
'results'
][
'off_shift_ratio'
][
0
]))
nextId
=
self
.
getSuccessors
(
data
,
obj
[
'id'
])[
0
]
nextClass
=
data
[
'graph'
][
'node'
][
nextId
][
'_class'
]
objResults
=
copy
(
obj
[
'results'
])
# if a station is before batch-reassembly then the blockage of reassembly is added to the station
# and reducted from its waiting
nextResults
=
{}
if
nextClass
.
startswith
(
'Dream.BatchReassembly'
):
for
nextObj
in
result
[
'elementList'
]:
if
nextObj
[
'id'
]
==
nextId
:
nextResults
=
nextObj
[
"results"
]
if
nextResults
:
nextBlockage
=
nextResults
[
'blockage_ratio'
][
0
]
objResults
[
'blockage_ratio'
][
0
]
=
nextBlockage
objResults
[
'waiting_ratio'
][
0
]
-=
nextBlockage
if
objResults
[
'working_ratio'
]:
working_data
.
append
((
i
,
objResults
[
'working_ratio'
][
0
]))
if
objResults
[
'waiting_ratio'
]:
waiting_data
.
append
((
i
,
objResults
[
'waiting_ratio'
][
0
]))
if
objResults
[
'failure_ratio'
]:
failure_data
.
append
((
i
,
objResults
[
'failure_ratio'
][
0
]))
if
objResults
[
'blockage_ratio'
]:
blockage_data
.
append
((
i
,
objResults
[
'blockage_ratio'
][
0
]))
if
objResults
[
'off_shift_ratio'
]:
off_shift_data
.
append
((
i
,
objResults
[
'off_shift_ratio'
][
0
]))
ticks
.
append
((
i
,
obj
.
get
(
'name'
,
obj
[
'id'
])))
i
+=
1
...
...
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