Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'output': 0.04; 'initialize': 0.05; '"the': 0.07; 'main()': 0.07; 'subject:()': 0.09; 'cc:addr:python-list': 0.10; 'steve': 0.13; '(the': 0.15; 'me.\xa0': 0.16; 'reason.': 0.16; 'subject:Problem': 0.16; 'subject:random': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'variables': 0.17; 'url:view': 0.18; '(or': 0.18; 'versions': 0.20; 'meant': 0.21; 'clock': 0.22; 'cc:2**0': 0.23; '>': 0.23; 'sets': 0.23; 'statement': 0.23; 'random': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '---': 0.26; 'appear': 0.26; '(which': 0.26; 'wondering': 0.26; 'executing': 0.27; 'message-id:@mail.gmail.com': 0.27; '-0700,': 0.29; "d'aprano": 0.29; 'steven': 0.29; 'no,': 0.29; 'objects': 0.29; 'url:code': 0.29; '"the': 0.29; 'skip:& 10': 0.29; 'probably': 0.29; 'class': 0.29; 'related': 0.30; 'code': 0.31; 'print': 0.32; 'says': 0.33; 'function.': 0.33; 'problem': 0.33; 'changed': 0.34; 'received:google.com': 0.34; 'so,': 0.35; 'too.': 0.35; 'add': 0.36; 'but': 0.36; 'url:org': 0.36; 'anything': 0.36; 'ok,': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'nothing': 0.38; 'delete': 0.38; 'think': 0.40; 'your': 0.60; 'mentioned': 0.63; 'different': 0.63; 'subject:this': 0.84; '2013': 0.84; 'simulation': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=wA2z5MbOwQvKbJ7ocPuEFcl/9E/kTTlfgLrRXeL63cM=; b=M9Zs90Eqq+YtwW1qzWxJ7FhqOhuzKTBg5ImEhr6nxoKOnpzF+ibwWG1BgxvKghdvQC Kn7sxDil+wPOqkrSNWrTPjDsvJjJ3eKDxDX6uLVu995x/QOFpO1SglOtSQbBaCbvgQuV Y0Il2vrME7WUXhxfWRyMmg4NsmtozOW6PDeHcPDInkojv+Q1HA50wO+o3wa/LakrJaFJ d74J12PKZgAk4JBvcFlEsGkQmrAQ+vI/AzsOK9CpOQThUe1OzwddLkISfaPx4eloOzk7 Xw84z8jgpYie22qTttygcXQi8PgxsY3BPhLMBoHWhDNX2o+EH7+np5Ri823qmwwJ/O27 gEGA== MIME-Version: 1.0 X-Received: by 10.180.83.10 with SMTP id m10mr5642346wiy.5.1363706376187; Tue, 19 Mar 2013 08:19:36 -0700 (PDT) In-Reply-To: <51487f93$0$30001$c3e8da3$5496439d@news.astraweb.com> References: <00329c02-21b7-438e-8551-0f4677d01474@googlegroups.com> <51487f93$0$30001$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 19 Mar 2013 15:19:36 +0000 Subject: Re: Problem this random seed() From: Sven To: "Steven D'Aprano" Content-Type: multipart/alternative; boundary=f46d04428eb621783b04d848a2ee Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 122 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363706384 news.xs4all.nl 6856 [2001:888:2000:d::a6]:50922 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41518 --f46d04428eb621783b04d848a2ee Content-Type: text/plain; charset=ISO-8859-1 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 --f46d04428eb621783b04d848a2ee Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On 19 March 2013 15:09, Steven D'Aprano <<= a href=3D"mailto:steve+comp.lang.python@pearwood.info" target=3D"_blank">st= eve+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 cla= ss
> 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.088683441311= 3
>
> Result =3D =A00.0571622124959
> 0.134729071364
> 0.00255530717358
> 0.088683441311= 3
>
> Result =3D =A00.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 s= ay anything
about time. I mentioned the random number generator *seed*.


I think he meant me.
= =A0
> 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 appea= r
> in your program before any SimPy process objects are activated."<= br>
That has nothing to do with the random numbers generated by expovaria= te().

<= br>
No, but in early versions he was printing out the time = (or a time related term) and was wondering why that is different too.=A0
=A0
--
./Sven
--f46d04428eb621783b04d848a2ee--