From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa81b07d7c3d2d7d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-31 20:45:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cs.utexas.edu!geraldo.cc.utexas.edu!not-for-mail From: "Bobby D. Bryant" Newsgroups: comp.lang.ada Subject: Re: Random numbers in tasks Date: Sat, 31 May 2003 21:42:34 -0600 Organization: dis- Message-ID: References: NNTP-Posting-Host: dial-32-7.ots.utexas.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: geraldo.cc.utexas.edu 1054438983 28697 128.83.111.55 (1 Jun 2003 03:43:03 GMT) X-Complaints-To: abuse@utexas.edu NNTP-Posting-Date: Sun, 1 Jun 2003 03:43:03 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:38266 Date: 2003-05-31T21:42:34-06:00 List-Id: On Sat, 31 May 2003 21:09:30 -0500, David C. Hoos wrote: > "Papastefanos Serafeim" wrote in message > news:bbb8o5$2711$1@ulysses.noc.ntua.gr... >> I am trying to model a simulation in Ada95 with gnat. There are some >> tasks of the same type that use random numbers. Is there a way to make >> every task get its own sequence of random numbers ? >> > Yes. The task body should declare the generator object. Each instance > of the task type, therefore will have its own generator object. And initialize them with different seeds, or they'll all spew the same stream of numbers. -- Bobby Bryant Austin, Texas