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
23e931c7
Commit
23e931c7
authored
May 23, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in operator that must have been broken in merge
parent
21201865
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
36 deletions
+9
-36
dream/simulation/Operator.py
dream/simulation/Operator.py
+9
-36
No files found.
dream/simulation/Operator.py
View file @
23e931c7
...
...
@@ -353,42 +353,15 @@ class Operator(ObjectResource):
# =======================================================================
def
outputResultsJSON
(
self
):
from
Globals
import
G
# if we had just one replication output the results to JSON
from
Globals
import
getConfidenceIntervals
json
=
{
'_class'
:
self
.
class_name
,
'id'
:
self
.
id
,
'results'
:
{}}
if
(
G
.
numberOfReplications
==
1
):
json
=
{}
json
[
'_class'
]
=
'Dream.'
+
self
.
type
;
json
[
'id'
]
=
str
(
self
.
id
)
json
[
'results'
]
=
{}
json
[
'results'
][
'working_ratio'
]
=
100
*
self
.
totalWorkingTime
/
G
.
maxSimTime
json
[
'results'
][
'waiting_ratio'
]
=
100
*
self
.
totalWaitingTime
/
G
.
maxSimTime
#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
:
json
=
{}
json
[
'_class'
]
=
'Dream.Repairman'
;
json
[
'id'
]
=
str
(
self
.
id
)
json
[
'results'
]
=
{}
json
[
'results'
][
'working_ratio'
]
=
{}
if
self
.
checkIfArrayHasDifValues
(
self
.
Working
):
json
[
'results'
][
'working_ratio'
][
'min'
]
=
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
1
][
0
]
json
[
'results'
][
'working_ratio'
][
'avg'
]
=
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
0
]
json
[
'results'
][
'working_ratio'
][
'max'
]
=
stat
.
bayes_mvs
(
self
.
Working
,
G
.
confidenceLevel
)[
0
][
1
][
1
]
else
:
json
[
'results'
][
'working_ratio'
][
'min'
]
=
self
.
Working
[
0
]
json
[
'results'
][
'working_ratio'
][
'avg'
]
=
self
.
Working
[
0
]
json
[
'results'
][
'working_ratio'
][
'max'
]
=
self
.
Working
[
0
]
json
[
'results'
][
'waiting_ratio'
]
=
{}
if
self
.
checkIfArrayHasDifValues
(
self
.
Waiting
):
json
[
'results'
][
'waiting_ratio'
][
'min'
]
=
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
1
][
0
]
json
[
'results'
][
'waiting_ratio'
][
'avg'
]
=
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
0
]
json
[
'results'
][
'waiting_ratio'
][
'max'
]
=
stat
.
bayes_mvs
(
self
.
Waiting
,
G
.
confidenceLevel
)[
0
][
1
][
1
]
else
:
json
[
'results'
][
'waiting_ratio'
][
'min'
]
=
self
.
Waiting
[
0
]
json
[
'results'
][
'waiting_ratio'
][
'avg'
]
=
self
.
Waiting
[
0
]
json
[
'results'
][
'waiting_ratio'
][
'max'
]
=
self
.
Waiting
[
0
]
json
[
'results'
][
'working_ratio'
]
=
getConfidenceIntervals
(
self
.
Working
)
json
[
'results'
][
'waiting_ratio'
]
=
getConfidenceIntervals
(
self
.
Waiting
)
G
.
outputJSON
[
'elementList'
].
append
(
json
)
\ No newline at end of file
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