Problem this random seed()
svenito at gmail.com
Tue Mar 19 16:05:44 CET 2013
On 19 March 2013 14:44, NZach <nickzacharatos at gmail.com> wrote:
> OK, i changed the code again. Delete the G class (The purpose of G class
> was to refer to global variables). Add Rnd.seed(12345) in main() function.
> The new code : http://codeviewer.org/view/code:30da
> i print the Rnd.expovariate(ArrivalClass.ArvRate).
> The output i get be executing the above code is the following :
> Result = 0.0571622124959
> Result = 0.0453791550084
> So, the problem is probably with time (which is what @Stev mentioned
> But i still cant understand the reason. From the SimPy documentation :
> it says for the initialize(): "The initialize statement initialises global
> simulation variables and sets the software clock to 0.0. It must appear in
> your program before any SimPy process objects are activated."
> Any idea why that happens
I am guessing it's because now gives you the current clock value. Yes,
initialise sets it to 0.0, but on execution now will change to the time
since initialise(), so you will get varying values. That's my best guess
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list