Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'output': 0.04; 'initialize': 0.05; 'main()': 0.07; 'subject:()': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '(the': 0.15; 'reason.': 0.16; 'subject:Problem': 0.16; 'subject:random': 0.16; 'variables': 0.17; 'url:view': 0.18; 'clock': 0.22; 'sets': 0.23; 'statement': 0.23; 'idea': 0.24; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; '---': 0.26; 'appear': 0.26; '(which': 0.26; 'cc:addr:gmail.com': 0.27; 'executing': 0.27; 'objects': 0.29; 'url:code': 0.29; '"the': 0.29; 'probably': 0.29; 'class': 0.29; '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; 'received:209.85': 0.35; 'add': 0.36; 'but': 0.36; 'url:org': 0.36; 'ok,': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'delete': 0.38; 'your': 0.60; 'mentioned': 0.63; 'subject:this': 0.84; 'simulation': 0.84 X-Received: by 10.50.161.225 with SMTP id xv1mr415145igb.15.1363704288429; Tue, 19 Mar 2013 07:44:48 -0700 (PDT) Newsgroups: comp.lang.python Date: Tue, 19 Mar 2013 07:44:47 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=37.6.76.12; posting-account=rydKFwoAAAAzONNNCagMlM8pALXkY1Rw References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 37.6.76.12 MIME-Version: 1.0 Subject: Re: Problem this random seed() From: NZach To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: NZach , 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: , Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363709362 news.xs4all.nl 6842 [2001:888:2000:d::a6]:37680 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41533 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). 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." Any idea why that happens ?