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
7e2d8827
Commit
7e2d8827
authored
Jan 03, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples that use failures updated
parent
70bfa1f3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
4 deletions
+44
-4
ManPy_documentation.pdf
ManPy_documentation.pdf
+0
-0
dream/simulation/Examples/TwoServers.py
dream/simulation/Examples/TwoServers.py
+15
-2
dream/simulation/Examples/TwoServersPlots.py
dream/simulation/Examples/TwoServersPlots.py
+13
-0
dream/simulation/Examples/TwoServersStochastic.py
dream/simulation/Examples/TwoServersStochastic.py
+16
-2
No files found.
ManPy_documentation.pdf
View file @
7e2d8827
No preview for this file type
dream/simulation/Examples/TwoServers.py
View file @
7e2d8827
...
...
@@ -6,17 +6,24 @@ from simulation.Part import Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
,
failureDistribution
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
,
failureDistribution
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
)
E
=
Exit
(
'E1'
,
'Exit'
)
#create failures
F1
=
Failure
(
victim
=
M1
,
distributionType
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distributionType
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
G
.
ObjList
=
[
S
,
M1
,
M2
,
E
,
Q
]
#add all the objects in G.ObjList so that they can be easier accessed later
G
.
FailureList
=
[
F1
,
F2
]
#add all the objects in G.ObjList so that they can be easier accessed later
#define predecessors and successors for the objects
S
.
defineRouting
([
M1
])
M1
.
defineRouting
([
S
],[
Q
])
...
...
@@ -32,10 +39,16 @@ R.initialize()
for
object
in
G
.
ObjList
:
object
.
initialize
()
for
failure
in
G
.
FailureList
:
failure
.
initialize
()
#activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
for
failure
in
G
.
FailureList
:
activate
(
failure
,
failure
.
run
())
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
simulate
(
until
=
G
.
maxSimTime
)
#run the simulation
...
...
dream/simulation/Examples/TwoServersPlots.py
View file @
7e2d8827
...
...
@@ -6,6 +6,7 @@ from simulation.Part import Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
#import Graphs
from
outputanalysis.Plots
import
Graphs
...
...
@@ -18,8 +19,14 @@ Q=Queue('Q1','Queue')
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
,
failureDistribution
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
E
=
Exit
(
'E1'
,
'Exit'
)
#create failures
F1
=
Failure
(
victim
=
M1
,
distributionType
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distributionType
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
G
.
ObjList
=
[
S
,
M1
,
M2
,
E
,
Q
]
#add all the objects in G.ObjList so that they can be easier accessed later
G
.
FailureList
=
[
F1
,
F2
]
#add all the objects in G.ObjList so that they can be easier accessed later
#define predecessors and successors for the objects
S
.
defineRouting
([
M1
])
M1
.
defineRouting
([
S
],[
Q
])
...
...
@@ -35,10 +42,16 @@ R.initialize()
for
object
in
G
.
ObjList
:
object
.
initialize
()
for
failure
in
G
.
FailureList
:
failure
.
initialize
()
#activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
for
failure
in
G
.
FailureList
:
activate
(
failure
,
failure
.
run
())
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
simulate
(
until
=
G
.
maxSimTime
)
#run the simulation
...
...
dream/simulation/Examples/TwoServersStochastic.py
View file @
7e2d8827
...
...
@@ -6,17 +6,24 @@ from simulation.Part import Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
distribution
=
'Normal'
,
mean
=
0.25
,
stdev
=
0.1
,
min
=
0.1
,
max
=
1
,
failureDistribution
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
distribution
=
'Normal'
,
mean
=
0.25
,
stdev
=
0.1
,
min
=
0.1
,
max
=
1
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
distribution
=
'Normal'
,
mean
=
1.5
,
stdev
=
0.3
,
min
=
0.5
,
max
=
5
,
failureDistribution
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
distribution
=
'Normal'
,
mean
=
1.5
,
stdev
=
0.3
,
min
=
0.5
,
max
=
5
)
E
=
Exit
(
'E1'
,
'Exit'
)
#create failures
F1
=
Failure
(
victim
=
M1
,
distributionType
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distributionType
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
G
.
ObjList
=
[
S
,
M1
,
M2
,
E
,
Q
]
#add all the objects in G.ObjList so that they can be easier accessed later
G
.
FailureList
=
[
F1
,
F2
]
#add all the objects in G.ObjList so that they can be easier accessed later
#define predecessors and successors for the objects
S
.
defineRouting
([
M1
])
M1
.
defineRouting
([
S
],[
Q
])
...
...
@@ -39,9 +46,16 @@ for i in range(G.numberOfReplications):
for
object
in
G
.
ObjList
:
object
.
initialize
()
for
failure
in
G
.
FailureList
:
failure
.
initialize
()
#activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
for
failure
in
G
.
FailureList
:
activate
(
failure
,
failure
.
run
())
simulate
(
until
=
G
.
maxSimTime
)
#run the simulation
#carry on the post processing operations for every object in the topology
...
...
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