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
8533a5ef
Commit
8533a5ef
authored
Oct 19, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
define static random number seed
parent
04b9936d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
dream/simulation/Examples/OperationalFailures.py
dream/simulation/Examples/OperationalFailures.py
+5
-3
No files found.
dream/simulation/Examples/OperationalFailures.py
View file @
8533a5ef
from
dream.simulation.imports
import
Machine
,
Queue
,
NonStarvingEntry
,
Exit
,
Part
,
EventGenerator
,
ExcelHandler
,
Part
from
dream.simulation.Globals
import
runSimulation
,
G
import
random
from
random
import
Random
Rnd
=
Random
(
3
)
p
=
0.01
g
=
0.01
...
...
@@ -111,7 +113,7 @@ def controllerMethod():
break
def
createRandomNumber
():
return
random
.
uniform
(
0
,
1
)
return
Rnd
.
uniform
(
0
,
1
)
#define the objects of the model
...
...
@@ -120,7 +122,7 @@ NS2=NonStarvingEntry('NS2','Entry2',entityData={'_class':'Dream.Part','status':'
M1
=
OpMachine
(
'M1'
,
'Machine1'
,
processingTime
=
{
'Fixed'
:{
'mean'
:
0.1
}})
M2
=
OpMachine
(
'M2'
,
'Machine2'
,
processingTime
=
{
'Fixed'
:{
'mean'
:
0.1
}})
M3
=
OpMachine
(
'M3'
,
'Machine3'
,
processingTime
=
{
'Fixed'
:{
'mean'
:
0.1
}})
B123
=
OpQueue
(
'B123'
,
'Queue'
,
capacity
=
45
)
B123
=
OpQueue
(
'B123'
,
'Queue'
,
capacity
=
10
)
E
=
OpExit
(
'E1'
,
'Exit'
)
Controller
=
EventGenerator
(
'EV'
,
'Controller'
,
start
=
0
,
interval
=
1
,
method
=
controllerMethod
)
...
...
@@ -142,7 +144,7 @@ for obj in objectList:
E
.
GoodExits
=
[]
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
1000
.01
,
numberOfReplications
=
50
)
runSimulation
(
objectList
,
1000
,
numberOfReplications
=
50
)
#print the results
PRt
=
sum
(
E
.
Exits
)
/
float
(
len
(
E
.
Exits
))
...
...
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