Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41518

Re: Problem this random seed()

References (2 earlier) <mailman.3495.1363694370.2939.python-list@python.org> <a40ab4ab-a9cb-4a96-a4b6-d4eaa09dd8a4@googlegroups.com> <mailman.3506.1363702753.2939.python-list@python.org> <00329c02-21b7-438e-8551-0f4677d01474@googlegroups.com> <51487f93$0$30001$c3e8da3$5496439d@news.astraweb.com>
Date 2013-03-19 15:19 +0000
Subject Re: Problem this random seed()
From Sven <svenito@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3518.1363706384.2939.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 19 March 2013 15:09, Steven D'Aprano <
steve+comp.lang.python@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. 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 : ---
> > 0.134729071364
> > 0.00255530717358
> > 0.0886834413113
> >
> > Result =  0.0571622124959
> > 0.134729071364
> > 0.00255530717358
> > 0.0886834413113
> >
> > Result =  0.0453791550084
> > ---
> >
> >
> > So, the problem is probably with time (which is what @Stev mentioned
> > before).
>
> Who is "Stev"? If you mean me, Steve or Steven, I did not say anything
> about time. I mentioned the random number generator *seed*.
>
>
I think he meant me.


> > But i still cant understand the reason. From the SimPy documentation :
> > http://simpy.sourceforge.net/SimPyDocs/Manuals/SManual.html 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."
>
> That has nothing to do with the random numbers generated by expovariate().
>
>
No, but in early versions he was printing out the time (or a time related
term) and was wondering why that is different too.

-- 
./Sven

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-18 18:57 -0700
  Re: Problem this random seed() eli m <techgeek201@gmail.com> - 2013-03-18 19:36 -0700
  Re: Problem this random seed() alex23 <wuwei23@gmail.com> - 2013-03-18 19:51 -0700
    Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 03:52 -0700
  Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 03:54 -0700
    Re: Problem this random seed() Sven <svenito@gmail.com> - 2013-03-19 11:59 +0000
      Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 05:27 -0700
      Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 05:27 -0700
      Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 06:50 -0700
        Re: Problem this random seed() Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-19 14:18 +0000
        Re: Problem this random seed() Sven <svenito@gmail.com> - 2013-03-19 14:19 +0000
          Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 07:44 -0700
            Re: Problem this random seed() Sven <svenito@gmail.com> - 2013-03-19 15:05 +0000
            Re: Problem this random seed() Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-19 15:09 +0000
              Re: Problem this random seed() Sven <svenito@gmail.com> - 2013-03-19 15:19 +0000
          Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 07:44 -0700
      Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 06:50 -0700
  Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 07:18 -0700
  Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 08:23 -0700
    Re: Problem this random seed() NZach <nickzacharatos@gmail.com> - 2013-03-19 08:26 -0700

csiph-web