Commit b30608dc authored by Georgios Dagkakis's avatar Georgios Dagkakis

examples to use the seed correctly

parent e5eb6c70
...@@ -410,6 +410,12 @@ def runSimulation(objectList=[], maxSimTime=100, numberOfReplications=1, trace=' ...@@ -410,6 +410,12 @@ 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment