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
ba373891
Commit
ba373891
authored
Feb 09, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
outputResultXL and getConfidenceInterval removed, they should both be post processing
parent
b8b90acf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
3 additions
and
316 deletions
+3
-316
dream/simulation/Assembly.py
dream/simulation/Assembly.py
+1
-42
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+0
-1
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+0
-46
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+0
-7
dream/simulation/Dismantle.py
dream/simulation/Dismantle.py
+1
-42
dream/simulation/Exit.py
dream/simulation/Exit.py
+0
-51
dream/simulation/Globals.py
dream/simulation/Globals.py
+0
-18
dream/simulation/Machine.py
dream/simulation/Machine.py
+0
-58
dream/simulation/ManPyObject.py
dream/simulation/ManPyObject.py
+1
-7
dream/simulation/Operator.py
dream/simulation/Operator.py
+0
-44
No files found.
dream/simulation/Assembly.py
View file @
ba373891
...
...
@@ -383,53 +383,12 @@ class Assembly(CoreObject):
activeObjectQueue
.
append
(
entity
)
#get the frame and append it to the internal queue
#===========================================================================
# outputs data to "output.xls"
#===========================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Blockage of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalBlockageTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Waiting of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Working of "
+
self
.
objName
+
" is:"
)
working_ci
=
getConfidenceIntervals
(
self
.
Working
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
working_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
working_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
working_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Blockage of "
+
self
.
objName
+
" is:"
)
blockage_ci
=
getConfidenceIntervals
(
self
.
Blockage
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
blockage_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
blockage_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
blockage_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Waiting of "
+
self
.
objName
+
" is:"
)
waiting_ci
=
getConfidenceIntervals
(
self
.
Waiting
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
waiting_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
waiting_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
waiting_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
#===========================================================================
# outputs results to JSON File
#===========================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
self
.
class_name
,
'id'
:
self
.
id
,
'results'
:
{}}
...
...
dream/simulation/BatchReassembly.py
View file @
ba373891
...
...
@@ -336,7 +336,6 @@ class BatchReassembly(CoreObject):
def
outputResultsJSON
(
self
):
if
self
.
outputResults
:
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
'Dream.%s'
%
self
.
__class__
.
__name__
,
'id'
:
self
.
id
,
'family'
:
self
.
family
,
...
...
dream/simulation/Conveyer.py
View file @
ba373891
...
...
@@ -442,57 +442,11 @@ class Conveyer(CoreObject):
self
.
Working
.
append
(
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
self
.
Blockage
.
append
(
100
*
self
.
totalBlockageTime
/
MaxSimtime
)
#===========================================================================
# outputs data to "output.xls"
#===========================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Blockage of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalBlockageTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Waiting of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
else
:
#if we had multiple replications we output confidence intervals to excel
#for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
#so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
#so for each output value we check if there was difference in the runs' results
#if yes we output the Confidence Intervals. if not we output just the fix value
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Working of "
+
self
.
objName
+
" is:"
)
working_ci
=
getConfidenceIntervals
(
self
.
Working
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
working_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
working_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
working_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Blockage of "
+
self
.
objName
+
" is:"
)
blockage_ci
=
getConfidenceIntervals
(
self
.
Blockage
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
blockage_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
blockage_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
blockage_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Waiting of "
+
self
.
objName
+
" is:"
)
waiting_ci
=
getConfidenceIntervals
(
self
.
Waiting
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
waiting_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
waiting_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
waiting_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
#===========================================================================
# outputs results to JSON File
#===========================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
self
.
class_name
,
'id'
:
self
.
id
,
'results'
:
{}}
...
...
dream/simulation/CoreObject.py
View file @
ba373891
...
...
@@ -661,13 +661,6 @@ class CoreObject(ManPyObject):
activeObject
.
SettingUp
.
append
(
100
*
self
.
totalSetupTime
/
MaxSimtime
)
activeObject
.
OffShift
.
append
(
100
*
self
.
totalOffShiftTime
/
MaxSimtime
)
# =======================================================================
# outputs data to "output.xls"
# =======================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
pass
# =======================================================================
# outputs results to JSON File
# =======================================================================
...
...
dream/simulation/Dismantle.py
View file @
ba373891
...
...
@@ -320,53 +320,12 @@ class Dismantle(CoreObject):
G
.
sheetIndex
+=
1
G
.
traceSheet
=
G
.
traceFile
.
add_sheet
(
'sheet '
+
str
(
G
.
sheetIndex
),
cell_overwrite_ok
=
True
)
#===========================================================================
# outputs data to "output.xls"
#===========================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Blockage of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalBlockageTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Waiting of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Working of "
+
self
.
objName
+
" is:"
)
working_ci
=
getConfidenceIntervals
(
self
.
Working
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
working_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
working_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
working_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Blockage of "
+
self
.
objName
+
" is:"
)
blockage_ci
=
getConfidenceIntervals
(
self
.
Blockage
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
blockage_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
blockage_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
blockage_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Waiting of "
+
self
.
objName
+
" is:"
)
waiting_ci
=
getConfidenceIntervals
(
self
.
Waiting
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
waiting_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
waiting_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
waiting_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
#===========================================================================
# outputs results to JSON File
#===========================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
self
.
class_name
,
'id'
:
self
.
id
,
'results'
:
{}}
...
...
dream/simulation/Exit.py
View file @
ba373891
...
...
@@ -162,61 +162,10 @@ class Exit(CoreObject):
self
.
TaktTime
.
append
(
0
)
# =======================================================================
# outputs data to "output.xls"
# =======================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The Throughput in "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
numOfExits
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The average lifespan of an entity that exited from "
+
self
.
objName
+
" is:"
)
try
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,((
self
.
totalLifespan
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
0
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The average takt time in "
+
self
.
objName
+
" is:"
)
try
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,((
self
.
totalTaktTime
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
0
)
G
.
outputIndex
+=
1
else
:
#if we had multiple replications we output confidence intervals to excel
#for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
#so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
#so for each output value we check if there was difference in the runs' results
#if yes we output the Confidence Intervals. if not we output just the fix value
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean Throughput in "
+
self
.
objName
+
" is:"
)
throughput_ci
=
getConfidenceIntervals
(
self
.
Exits
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
throughput_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
throughput_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
throughput_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean Lifespan of an entity that exited from "
+
self
.
objName
+
" is:"
)
lifespan_ci
=
getConfidenceIntervals
(
self
.
Lifespan
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
lifespan_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
lifespan_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
lifespan_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the avg takt time in "
+
self
.
objName
+
" is:"
)
takt_time_ci
=
getConfidenceIntervals
(
self
.
TaktTime
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
takt_time_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
takt_time_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
takt_time_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
# =======================================================================
# outputs results to JSON File
# =======================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
'Dream.%s'
%
self
.
__class__
.
__name__
,
'id'
:
self
.
id
,
'family'
:
self
.
family
,
...
...
dream/simulation/Globals.py
View file @
ba373891
...
...
@@ -306,24 +306,6 @@ def countIntervalThroughput(**kw):
currentExited
+=
totalExited
-
previouslyExited
obj
.
intervalThroughPutList
.
append
(
currentExited
)
# =======================================================================
# Helper function to calculate the confidence intervals of a serie.
# =======================================================================
def
getConfidenceIntervals
(
value_list
):
from
Globals
import
G
if
len
(
set
(
value_list
))
==
1
:
# All values are same, no need to perform statistical analysis
return
{
'lb'
:
value_list
[
0
],
'ub'
:
value_list
[
0
],
'avg'
:
value_list
[
0
],
}
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
Intervals
from
dream.KnowledgeExtraction.StatisticalMeasures
import
BasicStatisticalMeasures
BSM
=
BasicStatisticalMeasures
()
lb
,
ub
=
Intervals
().
ConfidIntervals
(
value_list
,
G
.
confidenceLevel
)
return
{
'lb'
:
lb
,
'ub'
:
ub
,
'avg'
:
BSM
.
mean
(
value_list
)
}
# #===========================================================================
# # printTrace
...
...
dream/simulation/Machine.py
View file @
ba373891
...
...
@@ -1171,70 +1171,12 @@ class Machine(CoreObject):
# =======================================================================
def
isOperated
(
self
):
return
self
.
toBeOperated
# =======================================================================
# outputs the the "output.xls"
# =======================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Failure of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalFailureTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Blockage of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalBlockageTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Waiting of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
else
:
#if we had multiple replications we output confidence intervals to excel
#for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
#so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
#so for each output value we check if there was difference in the runs' results
#if yes we output the Confidence Intervals. if not we output just the fix value
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Failure of "
+
self
.
objName
+
" is:"
)
failure_ci
=
getConfidenceIntervals
(
self
.
Failure
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
failure_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
failure_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
failure_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Working of "
+
self
.
objName
+
" is:"
)
working_ci
=
getConfidenceIntervals
(
self
.
Working
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
working_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
working_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
working_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Blockage of "
+
self
.
objName
+
" is:"
)
blockage_ci
=
getConfidenceIntervals
(
self
.
Blockage
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
blockage_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
blockage_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
blockage_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Waiting of "
+
self
.
objName
+
" is:"
)
waiting_ci
=
getConfidenceIntervals
(
self
.
Waiting
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
waiting_ci
[
'min'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
waiting_ci
[
'avg'
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
waiting_ci
[
'max'
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
# =======================================================================
# outputs results to JSON File
# =======================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
'Dream.%s'
%
self
.
__class__
.
__name__
,
'id'
:
self
.
id
,
'family'
:
self
.
family
,
...
...
dream/simulation/ManPyObject.py
View file @
ba373891
...
...
@@ -167,13 +167,7 @@ class ManPyObject(object):
#===========================================================================
def
postProcessing
(
self
):
pass
# =======================================================================
# outputs data to "output.xls"
# =======================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
pass
# =======================================================================
# outputs results to JSON File
# =======================================================================
...
...
dream/simulation/Operator.py
View file @
ba373891
...
...
@@ -270,56 +270,12 @@ class Operator(ObjectResource):
self
.
Waiting
.
append
(
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
self
.
Working
.
append
(
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
self
.
OffShift
.
append
(
100
*
self
.
totalOffShiftTime
/
MaxSimtime
)
# =======================================================================
# outputs data to "output.xls"
# =======================================================================
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
# if we had just one replication output the results to excel
if
(
G
.
numberOfReplications
==
1
):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of waiting of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWaitingTime
/
MaxSimtime
)
G
.
outputIndex
+=
1
#if we had multiple replications we output confidence intervals to excel
# for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
# so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
# so for each output value we check if there was difference in the runs' results
# if yes we output the Confidence Intervals. if not we output just the fix value
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Working of "
+
self
.
objName
+
" is:"
)
if
self
.
checkIfArrayHasDifValues
(
self
.
Working
):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
1
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
1
][
1
])
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
Working
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
self
.
Working
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
self
.
Working
[
0
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the mean percentage of Waiting of "
+
self
.
objName
+
" is:"
)
if
self
.
checkIfArrayHasDifValues
(
self
.
Waiting
):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
1
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
1
][
1
])
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
Waiting
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
self
.
Waiting
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
self
.
Waiting
[
0
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
# =======================================================================
# outputs results to JSON File
# =======================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
'Dream.%s'
%
self
.
__class__
.
__name__
,
'id'
:
self
.
id
,
'family'
:
self
.
family
,
...
...
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