Problem this random seed()

NZach nickzacharatos at gmail.com
Tue Mar 19 09:50:34 EDT 2013


Sorry, my previous reply was completely wrong. The time is initialized through the initialize() to 0. So, each time i call main() the simulation time is initialized to 0.

I changed the code in order to print and check the values of 

G.Rnd.expovariate(MachineClass.SrvRate) and G.Rnd.expovariate(ArrivalClass.ArvRate)

here is the code and the changes i made : http://codeviewer.org/view/code:30d8

The values are not the same.

The result i take is the following:

Result from main() call No. 1 is 0.0452927906737
Result from main() call No. 2 is 0.0588336669949
2
First time Execution of Main Main
[0.07267291894782457, 0.019146562687989536, 0.034780398625615376, 0.005528912370370478, 0.023636815811338075]
[0.13472907136407936, 0.0025553071735785462, 0.08868344131130483, 0.05381286556098766, 0.044091180681591464]
Second time Execution of Main
[0.0335704752213292, 0.1321512230812724, 0.16025979406301488, 0.029210377271523574, 0.006680846943670858]
[0.20642889529587374, 0.047894131266223446, 0.10958802111803392, 0.02393344456847461, 0.13280785022932287]



More information about the Python-list mailing list