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
7a0a1f88
Commit
7a0a1f88
authored
Mar 10, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TwoServers Example editted to match new notations
parent
e48b2494
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
dream/simulation/Examples/TwoServers.py
dream/simulation/Examples/TwoServers.py
+5
-24
No files found.
dream/simulation/Examples/TwoServers.py
View file @
7a0a1f88
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'
,
interarrivalTime
=
interarrivalTimeS
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
processingTime
=
processingTimeM1
)
S
=
Source
(
'S1'
,
'Source'
,
interarrivalTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.5
}
,
entity
=
'Dream.Part'
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.25
}
)
Q
=
Queue
(
'Q1'
,
'Queue'
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
processingTime
=
processingTimeM2
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1.5
}
)
E
=
Exit
(
'E1'
,
'Exit'
)
#create failures
F1
=
Failure
(
victim
=
M1
,
distribution
=
failure1Distribution
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distribution
=
failure2Distribution
,
repairman
=
R
)
F1
=
Failure
(
victim
=
M1
,
distribution
=
{
'distributionType'
:
'Fixed'
,
'MTTF'
:
60
,
'MTTR'
:
5
}
,
repairman
=
R
)
F2
=
Failure
(
victim
=
M2
,
distribution
=
{
'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
.
MachineList
=
[
M1
,
M2
]
...
...
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