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
618b8084
Commit
618b8084
authored
Jun 04, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TwoServersStochastic example updated to match the new notation. Also in the documentation
parent
99719b39
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
34 deletions
+48
-34
ManPy_documentation.doc
ManPy_documentation.doc
+0
-0
ManPy_documentation.pdf
ManPy_documentation.pdf
+0
-0
dream/simulation/Examples/TwoServersStochastic.py
dream/simulation/Examples/TwoServersStochastic.py
+48
-34
No files found.
ManPy_documentation.doc
View file @
618b8084
No preview for this file type
ManPy_documentation.pdf
View file @
618b8084
No preview for this file type
dream/simulation/Examples/TwoServersStochastic.py
View file @
618b8084
from
dream.simulation.imports
import
Machine
,
Source
,
Exit
,
Part
,
G
,
Repairman
,
Queue
,
Failure
from
dream.simulation.imports
import
simpy
G
.
env
=
simpy
.
Environment
()
# define a simpy environment
# this is where all the simulation object 'live'
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
S
=
Source
(
'S1'
,
'Source'
,
interarrivalTime
=
{
'distributionType'
:
'Exp'
,
'mean'
:
0.5
},
entity
=
'Dream.Part'
)
...
...
@@ -31,10 +28,16 @@ G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
G
.
numberOfReplications
=
10
#set 10 replications
G
.
confidenceLevel
=
0.99
#set the confidence level. 0.99=99%
#run the replications
for
i
in
range
(
G
.
numberOfReplications
):
def
main
():
throughputList
=
[]
# a list to hold the throughput of each replication
#run the replications
for
i
in
range
(
G
.
numberOfReplications
):
G
.
seed
+=
1
#increment the seed so that we get different random numbers in each run.
G
.
env
=
simpy
.
Environment
()
# define a simpy environment
# this is where all the simulation object 'live'
#initialize all the objects
for
object
in
G
.
ObjList
:
object
.
initialize
()
...
...
@@ -61,10 +64,21 @@ for i in range(G.numberOfReplications):
for
objectResource
in
G
.
ObjectResourceList
:
objectResource
.
postProcessing
()
#output data to excel for every object
for
object
in
G
.
ObjList
:
object
.
outputResultsXL
()
R
.
outputResultsXL
()
# append the numbe of exits in the throughputList
throughputList
.
append
(
E
.
numOfExits
)
print
'The exit of each replication is:'
print
throughputList
G
.
outputFile
.
save
(
"output.xls"
)
# calculate confidence interval using the Knowledge Extraction tool
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
Intervals
from
dream.KnowledgeExtraction.StatisticalMeasures
import
BasicStatisticalMeasures
BSM
=
BasicStatisticalMeasures
()
lb
,
ub
=
Intervals
().
ConfidIntervals
(
throughputList
,
0.95
)
print
'the 95% confidence interval for the throughput is:'
print
'lower bound:'
,
lb
print
'mean:'
,
BSM
.
mean
(
throughputList
)
print
'upper bound:'
,
ub
if
__name__
==
'__main__'
:
main
()
\ 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