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
b30608dc
Commit
b30608dc
authored
9 years ago
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples to use the seed correctly
parent
e5eb6c70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
dream/simulation/Globals.py
dream/simulation/Globals.py
+7
-1
No files found.
dream/simulation/Globals.py
View file @
b30608dc
...
@@ -410,8 +410,14 @@ def runSimulation(objectList=[], maxSimTime=100, numberOfReplications=1, trace='
...
@@ -410,8 +410,14 @@ def runSimulation(objectList=[], maxSimTime=100, numberOfReplications=1, trace='
#run the replications
#run the replications
for
i
in
range
(
G
.
numberOfReplications
):
for
i
in
range
(
G
.
numberOfReplications
):
if
G
.
seed
:
G
.
Rnd
=
Random
(
'%s%s'
%
(
G
.
seed
,
i
))
G
.
numpyRnd
.
random
.
seed
(
G
.
seed
)
else
:
G
.
Rnd
=
Random
()
G
.
numpyRnd
.
random
.
seed
()
G
.
seed
+=
1
#increment the seed so that we get different random numbers in each run.
G
.
seed
+=
1
#increment the seed so that we get different random numbers in each run.
G
.
env
=
simpy
.
Environment
()
# define a simpy environment
G
.
env
=
simpy
.
Environment
()
# define a simpy environment
# this is where all the simulation object 'live'
# this is where all the simulation object 'live'
...
...
This diff is collapsed.
Click to expand it.
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