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
d9970ac0
Commit
d9970ac0
authored
Oct 23, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addition to plot B123 if need be
parent
a5385557
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
dream/simulation/Examples/OperationalFailures.py
dream/simulation/Examples/OperationalFailures.py
+31
-2
No files found.
dream/simulation/Examples/OperationalFailures.py
View file @
d9970ac0
...
...
@@ -8,10 +8,10 @@ import time
start
=
time
.
time
()
# simulation time
maxSimTime
=
1
0
maxSimTime
=
20
0
# the capacity of B123
capacity
=
3
#float('inf')
capacity
=
42
#float('inf')
class
OpQueue
(
Queue
):
# allow to be locked between the time periods
...
...
@@ -240,3 +240,32 @@ for M in [M1,M2,M3]:
# ExcelHandler.outputTrace('OperationalFailures')
print
"running time="
,
time
.
time
()
-
start
from
rpy2
import
robjects
from
rpy2.robjects.vectors
import
IntVector
,
FloatVector
,
StrVector
from
rpy2.robjects.packages
import
importr
from
rpy2.rinterface
import
NA_Real
# to plot B123 if we want
base
=
importr
(
"base"
)
stats
=
importr
(
"stats"
)
grdevices
=
importr
(
"grDevices"
)
graphics
=
importr
(
"graphics"
)
graphWipStatList
=
list
(
B123
.
wipStatList
)
index
=
0
for
i
in
range
(
len
(
B123
.
wipStatList
)
-
1
):
if
B123
.
wipStatList
[
i
][
0
]
==
B123
.
wipStatList
[
i
+
1
][
0
]:
del
graphWipStatList
[
index
]
else
:
index
+=
1
simTime
=
[
x
[
0
]
for
x
in
graphWipStatList
]
bufferLevel
=
[
x
[
1
]
for
x
in
graphWipStatList
]
grdevices
.
png
(
"B123 Buffer Level.png"
)
graphics
.
plot
(
simTime
,
bufferLevel
,
xlab
=
"Simulation Time"
,
ylab
=
"Buffer Level"
,
col
=
"red"
,
type
=
"l"
,
tck
=
1
)
graphics
.
title
(
"Buffer level time series"
)
grdevices
.
dev_off
()
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