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


Groups > comp.lang.python > #41496

Re: Problem this random seed()

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <nickzacharatos@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'skip:[ 20': 0.03; 'main()': 0.07; 'subject:()': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'subject:Problem': 0.16; 'subject:random': 0.16; 'url:view': 0.18; 'changes': 0.20; 'sorry,': 0.22; 'second': 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; 'values': 0.26; 'cc:addr:gmail.com': 0.27; 'execution': 0.27; 'initialized': 0.29; 'url:code': 0.29; 'code': 0.31; 'print': 0.32; 'changed': 0.34; 'received:google.com': 0.34; 'same.': 0.35; 'so,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'skip:g 30': 0.36; 'previous': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'first': 0.61; 'here': 0.65; 'reply': 0.66; 'subject:this': 0.84; 'simulation': 0.84
X-Received by 10.49.3.129 with SMTP id c1mr126209qec.40.1363701034273; Tue, 19 Mar 2013 06:50:34 -0700 (PDT)
Newsgroups comp.lang.python
Date Tue, 19 Mar 2013 06:50:34 -0700 (PDT)
In-Reply-To <mailman.3495.1363694370.2939.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=37.6.76.12; posting-account=rydKFwoAAAAzONNNCagMlM8pALXkY1Rw
References <c447cffe-964f-4f8e-9931-0c3b5ff9bf6d@googlegroups.com> <be57c21d-7f3c-473b-b553-8a68b84331db@googlegroups.com> <mailman.3495.1363694370.2939.python-list@python.org>
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 <nickzacharatos@gmail.com>
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc NZach <nickzacharatos@gmail.com>, python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.3504.1363701744.2939.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1363701744 news.xs4all.nl 6879 [2001:888:2000:d::a6]:60063
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41496

Show key headers only | View raw


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(ArrivalClass.ArvRate)

here is the code and the changes i made : http://codeviewer.org/view/code:30d8

The values are not the same.

The result i take is the following:

Result from main() call No. 1 is 0.0452927906737
Result from main() call No. 2 is 0.0588336669949
2
First time Execution of Main Main
[0.07267291894782457, 0.019146562687989536, 0.034780398625615376, 0.005528912370370478, 0.023636815811338075]
[0.13472907136407936, 0.0025553071735785462, 0.08868344131130483, 0.05381286556098766, 0.044091180681591464]
Second time Execution of Main
[0.0335704752213292, 0.1321512230812724, 0.16025979406301488, 0.029210377271523574, 0.006680846943670858]
[0.20642889529587374, 0.047894131266223446, 0.10958802111803392, 0.02393344456847461, 0.13280785022932287]

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