Re: Problem this random seed()

2013-03-19 Thread NZach
:30d3 > > > > > > > > > > > > The problem is that i am executing the main() function in lines 83 and 90, > > but > > > > > > i do not receive the same result, although the random seed is used in the > > G > >

Re: Problem this random seed()

2013-03-19 Thread NZach
ery little changes to the code and i have upload it here: > > http://codeviewer.org/view/code:30d3 > > > > The problem is that i am executing the main() function in lines 83 and 90, > but > > i do not receive the same result, although the random seed is used in

Re: Problem this random seed()

2013-03-19 Thread Sven
On 19 March 2013 15:09, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Tue, 19 Mar 2013 07:44:47 -0700, NZach 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

Re: Problem this random seed()

2013-03-19 Thread Sven
On 19 March 2013 14:44, NZach 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).

Re: Problem this random seed()

2013-03-19 Thread Steven D'Aprano
On Tue, 19 Mar 2013 07:44:47 -0700, NZach 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(ArrivalCla

Re: Problem this random seed()

2013-03-19 Thread NZach
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

Re: Problem this random seed()

2013-03-19 Thread NZach
Probably a better code : http://codeviewer.org/view/code:30d9 I run the program once using comment in line 39 and then using comment in line 62. The results are not the same. The problem is with the Random. Although, i use seed value equal to 12345, i do not take the same results. :[ Any idea

Re: Problem this random seed()

2013-03-19 Thread Steven D'Aprano
On Tue, 19 Mar 2013 06:50:34 -0700, NZach wrote: > 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

Re: Problem this random seed()

2013-03-19 Thread Sven
On 19 March 2013 13:50, NZach wrote: > 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.expovari

Re: Problem this random seed()

2013-03-19 Thread NZach
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

Re: Problem this random seed()

2013-03-19 Thread NZach
Thank you @sven ! I thought that the time was reset automatically after calling the second main. Yes, i checked the values and they are the same. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-19 Thread Sven
On 19 March 2013 10:54, NZach wrote: > @eli m : The problem is that i execute on lines 83 and 90 the main() and > although the seed value is the same, equal to 12345, i receive different > results from lines 85 and 92. > > @alex23: I changed the code, http://codeviewer.org/view/code:30d4, but i >

Re: Problem this random seed()

2013-03-19 Thread NZach
@eli m : The problem is that i execute on lines 83 and 90 the main() and although the seed value is the same, equal to 12345, i receive different results from lines 85 and 92. @alex23: I changed the code, http://codeviewer.org/view/code:30d4, but i still receive have the same problem. The resul

Re: Problem this random seed()

2013-03-19 Thread NZach
@eli m : The problem is that i execute on lines 83 and 90 the main() and although the seed value is the same, equal to 12345, i receive different results from lines 85 and 92. @alex23: I changed the code, http://codeviewer.org/view/code:30d4, but i still receive have the same problem. The resul

Re: Problem this random seed()

2013-03-18 Thread alex23
On Mar 19, 11:57 am, NZach wrote: > The problem is that i am executing  the main() function in lines 83 and 90, > but > i do not receive the  same result, although the random seed is used in the G > class. > > Any idea please, how can i solve it ? The seed is used to create a

Re: Problem this random seed()

2013-03-18 Thread eli m
changes to the code and i have upload it here: > > http://codeviewer.org/view/code:30d3 > > > > The problem is that i am executing the main() function in lines 83 and 90, > but > > i do not receive the same result, although the random seed is used in the G &

Problem this random seed()

2013-03-18 Thread NZach
executing the main() function in lines 83 and 90, but i do not receive the same result, although the random seed is used in the G class. Any idea please, how can i solve it ? Thanks, Nicholas. -- http://mail.python.org/mailman/listinfo/python-list

Re: random seed

2005-08-17 Thread Magnus Lycka
Robert Kern wrote: > random.seed(1234567890) > > is traditional and works just fine. > > Other favorites: > > 3141592653589793 > 2718281828459045 Nothing beats 42! (That was just an exclamation mark in the end, no factorial intended.) 371 is another nice number, since it's its own revers

Re: random seed

2005-08-16 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Thanks. I guess I will use the system time and pass it as seed > explicitly. My goal is to replicate the random numbers that I generate > to ensure repeatabilty in the regression test suite that I am trying > to write. In that case you should just pick a single seed yo

Re: random seed

2005-08-16 Thread vivek7006
Thanks. I guess I will use the system time and pass it as seed explicitly. My goal is to replicate the random numbers that I generate to ensure repeatabilty in the regression test suite that I am trying to write. -- http://mail.python.org/mailman/listinfo/python-list

Re: random seed

2005-08-16 Thread tiissa
[EMAIL PROTECTED] wrote: > By default, randomm module uses the timestamp to generate the seed > value. Is it possible to know what that seed value is? From a (very) quick glance at the doc [1], I'm not sure you can get it. But if you want to reuse it later (for a deterministic behaviour), you

random seed

2005-08-16 Thread vivek7006
By default, randomm module uses the timestamp to generate the seed value. Is it possible to know what that seed value is? import random random.random() # How do I print the current value of the seed? Thanks Vivek -- http://mail.python.org/mailman/listinfo/python-list