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
4819120e
Commit
4819120e
authored
Feb 23, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins added to output tabular data in exit and buffers
parent
a8f4b3cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2470 additions
and
2334 deletions
+2470
-2334
dream/plugins/BatchesTabularExit.py
dream/plugins/BatchesTabularExit.py
+71
-0
dream/plugins/BatchesTabularQueues.py
dream/plugins/BatchesTabularQueues.py
+57
-0
dream/simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
...simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
+4
-0
dream/simulation/Examples/GUI_models/BatchFullModel.json
dream/simulation/Examples/GUI_models/BatchFullModel.json
+2338
-2334
No files found.
dream/plugins/BatchesTabularExit.py
0 → 100644
View file @
4819120e
from
copy
import
copy
import
json
import
time
import
random
import
operator
import
StringIO
import
xlrd
from
dream.plugins
import
plugin
class
BatchesTabularExit
(
plugin
.
OutputPreparationPlugin
):
""" Output the exit stats in a tab
"""
def
postprocess
(
self
,
data
):
numberOfReplications
=
int
(
data
[
'general'
][
'numberOfReplications'
])
confidenceLevel
=
float
(
data
[
'general'
][
'confidenceLevel'
])
maxSimTime
=
data
[
'general'
][
'maxSimTime'
]
timeUnit
=
data
[
'general'
][
'timeUnit'
]
if
numberOfReplications
==
1
:
# create the titles of the columns
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
]
=
[[
'KPI'
,
'Unit'
,
'Value'
]]
# loop the results and search for elements that have 'Exit' as family
for
record
in
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]:
family
=
record
.
get
(
'family'
,
None
)
# when found, add a row with the results of the specific exit
if
family
==
'Exit'
:
batchesThroughput
=
record
[
'results'
][
'throughput'
][
0
]
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
'Number of batches produced'
,
'Batches'
,
batchesThroughput
])
unitsThroughput
=
record
[
'results'
][
'unitsThroughput'
][
0
]
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
'Number of units produced'
,
'Units'
,
unitsThroughput
])
lineThroughput
=
batchesThroughput
/
float
(
maxSimTime
)
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
'Line throughput'
,
'Batches/'
+
timeUnit
+
's'
,
lineThroughput
])
unitDepartureRate
=
unitsThroughput
/
float
(
maxSimTime
)
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
'Average Unit Departure Rate'
,
'Units/'
+
timeUnit
+
's'
,
unitDepartureRate
])
avgCycleTime
=
record
[
'results'
][
'lifespan'
][
0
]
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
'Average Cycle Time'
,
timeUnit
+
's'
,
avgCycleTime
])
elif
numberOfReplications
>
1
:
# create the titles of the columns
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
]
=
[[
'Exit Id'
,
''
,
'Throughput'
,
''
,
''
,
'Takt Time'
,
''
,
''
,
'Lifespan'
,
''
],
[
''
,
'LB'
,
'AVG'
,
'RB'
,
'LB'
,
'AVG'
,
'RB'
,
'LB'
,
'AVG'
,
'RB'
]]
for
record
in
data
[
'result'
][
'result_list'
][
0
][
'elementList'
]:
family
=
record
.
get
(
'family'
,
None
)
# when found, add a row with the results of the specific exit
if
family
==
'Exit'
:
exitId
=
record
[
'id'
]
throughput
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'throughput'
,
'undefined'
),
confidenceLevel
)
taktTime
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'takt_time'
,
'undefined'
),
confidenceLevel
)
lifespan
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'lifespan'
,
'undefined'
),
confidenceLevel
)
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
exitId
,
throughput
[
'lb'
],
throughput
[
'avg'
],
throughput
[
'ub'
],
taktTime
[
'lb'
],
taktTime
[
'avg'
],
taktTime
[
'ub'
],
lifespan
[
'lb'
],
lifespan
[
'avg'
],
lifespan
[
'ub'
]])
return
data
def
getConfidenceInterval
(
self
,
value_list
,
confidenceLevel
):
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
Intervals
from
dream.KnowledgeExtraction.StatisticalMeasures
import
BasicStatisticalMeasures
BSM
=
BasicStatisticalMeasures
()
lb
,
ub
=
Intervals
().
ConfidIntervals
(
value_list
,
confidenceLevel
)
return
{
'lb'
:
lb
,
'ub'
:
ub
,
'avg'
:
BSM
.
mean
(
value_list
)
}
\ No newline at end of file
dream/plugins/BatchesTabularQueues.py
0 → 100644
View file @
4819120e
from
copy
import
copy
import
json
import
time
import
random
import
operator
import
StringIO
import
xlrd
from
dream.plugins
import
plugin
class
DefaultTabularExit
(
plugin
.
OutputPreparationPlugin
):
""" Output the exit stats in a tab
"""
def
postprocess
(
self
,
data
):
numberOfReplications
=
int
(
data
[
'general'
][
'numberOfReplications'
])
confidenceLevel
=
float
(
data
[
'general'
][
'confidenceLevel'
])
if
numberOfReplications
==
1
:
# create the titles of the columns
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
]
=
[[
'Exit Id'
,
'Throughput'
,
'Takt Time'
,
'Lifespan'
]]
# loop the results and search for elements that have 'Exit' as family
for
record
in
data
[
'result'
][
'result_list'
][
0
][
'elementList'
]:
family
=
record
.
get
(
'family'
,
None
)
# when found, add a row with the results of the specific exit
if
family
==
'Exit'
:
exitId
=
record
[
'id'
]
throughput
=
record
[
'results'
].
get
(
'throughput'
,
'undefined'
)
taktTime
=
record
[
'results'
].
get
(
'takt_time'
,
'undefined'
)
lifespan
=
record
[
'results'
].
get
(
'lifespan'
,
'undefined'
)
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
exitId
,
throughput
,
taktTime
,
lifespan
])
elif
numberOfReplications
>
1
:
# create the titles of the columns
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
]
=
[[
'Exit Id'
,
''
,
'Throughput'
,
''
,
''
,
'Takt Time'
,
''
,
''
,
'Lifespan'
,
''
],
[
''
,
'LB'
,
'AVG'
,
'RB'
,
'LB'
,
'AVG'
,
'RB'
,
'LB'
,
'AVG'
,
'RB'
]]
for
record
in
data
[
'result'
][
'result_list'
][
0
][
'elementList'
]:
family
=
record
.
get
(
'family'
,
None
)
# when found, add a row with the results of the specific exit
if
family
==
'Exit'
:
exitId
=
record
[
'id'
]
throughput
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'throughput'
,
'undefined'
),
confidenceLevel
)
taktTime
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'takt_time'
,
'undefined'
),
confidenceLevel
)
lifespan
=
self
.
getConfidenceInterval
(
record
[
'results'
].
get
(
'lifespan'
,
'undefined'
),
confidenceLevel
)
data
[
'result'
][
'result_list'
][
0
][
'exit_output'
].
append
([
exitId
,
throughput
[
'lb'
],
throughput
[
'avg'
],
throughput
[
'ub'
],
taktTime
[
'lb'
],
taktTime
[
'avg'
],
taktTime
[
'ub'
],
lifespan
[
'lb'
],
lifespan
[
'avg'
],
lifespan
[
'ub'
]])
return
data
def
getConfidenceInterval
(
self
,
value_list
,
confidenceLevel
):
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
Intervals
from
dream.KnowledgeExtraction.StatisticalMeasures
import
BasicStatisticalMeasures
BSM
=
BasicStatisticalMeasures
()
lb
,
ub
=
Intervals
().
ConfidIntervals
(
value_list
,
confidenceLevel
)
return
{
'lb'
:
lb
,
'ub'
:
ub
,
'avg'
:
BSM
.
mean
(
value_list
)
}
\ No newline at end of file
dream/simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
View file @
4819120e
...
@@ -257,6 +257,10 @@
...
@@ -257,6 +257,10 @@
{
{
"_class"
:
"dream.plugins.PostProcessQueueStatistics.PostProcessQueueStatistics"
,
"_class"
:
"dream.plugins.PostProcessQueueStatistics.PostProcessQueueStatistics"
,
"output_id"
:
"queue_statistics"
"output_id"
:
"queue_statistics"
},
{
"_class"
:
"dream.plugins.BatchesTabularExit.BatchesTabularExit"
,
"output_id"
:
"exit_output"
}
}
]
]
},
},
...
...
dream/simulation/Examples/GUI_models/BatchFullModel.json
View file @
4819120e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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