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
71b8c72e
Commit
71b8c72e
authored
Mar 07, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TwoServers example changed to match new notation
parent
1ac8f292
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
dream/simulation/Examples/TwoServers.py
dream/simulation/Examples/TwoServers.py
+26
-6
No files found.
dream/simulation/Examples/TwoServers.py
View file @
71b8c72e
from
dream.simulation.imports
import
Machine
,
Source
,
Exit
,
Part
,
G
,
Repairman
,
Queue
,
Failure
from
dream.simulation.imports
import
simulate
,
activate
,
initialize
#define distributions as a dicts
interarrivalTimeS
=
{}
interarrivalTimeS
[
'distributionType'
]
=
'Fixed'
interarrivalTimeS
[
'mean'
]
=
0.5
processingTimeM1
=
{}
processingTimeM1
[
'distributionType'
]
=
'Fixed'
processingTimeM1
[
'mean'
]
=
0.25
processingTimeM2
=
{}
processingTimeM2
[
'distributionType'
]
=
'Fixed'
processingTimeM2
[
'mean'
]
=
1.5
failure1Distribution
=
{}
failure1Distribution
[
'failureDistribution'
]
=
'Fixed'
failure1Distribution
[
'MTTF'
]
=
60
failure1Distribution
[
'MTTR'
]
=
5
failure2Distribution
=
{}
failure2Distribution
[
'failureDistribution'
]
=
'Fixed'
failure2Distribution
[
'MTTF'
]
=
40
failure2Distribution
[
'MTTR'
]
=
10
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
mean
=
0.5
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.25
)
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
interarrivalTime
=
interarrivalTimeS
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
processingTime
=
processingTimeM1
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1.5
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
processingTime
=
processingTimeM2
)
E
=
Exit
(
'E1'
,
'Exit'
)
#create failures
F1
=
Failure
(
victim
=
M1
,
distribution
Type
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distribution
Type
=
'Fixed'
,
MTTF
=
40
,
MTTR
=
10
,
repairman
=
R
)
F1
=
Failure
(
victim
=
M1
,
distribution
=
failure1Distribution
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distribution
=
failure2Distribution
,
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
.
MachineList
=
[
M1
,
M2
]
G
.
ObjectInterruptionList
=
[
F1
,
F2
]
#add all the objects in G.ObjList so that they can be easier accessed later
...
...
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