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-Thread: 103376,8147387fe25d4e2a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 30 Dec 2010 12:53:51 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Random number generation References: <864o9vbkwz.fsf@gareth.avalon.lan> <8o3920Fn0vU1@mid.individual.net> In-Reply-To: <8o3920Fn0vU1@mid.individual.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4d1c72cf$0$6772$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 30 Dec 2010 12:53:51 CET NNTP-Posting-Host: 1cd7d3c4.newsspool3.arcor-online.net X-Trace: DXC=gc`BAG2^=ScPXlQ;h]GTMdMcF=Q^Z^V3h4Fo<]lROoRa8kFjLh>_cHTX3jm1NG`?CEUOYi X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:17221 Date: 2010-12-30T12:53:51+01:00 List-Id: On 30.12.10 12:34, Niklas Holsti wrote: > If every call of Roll is returning the same results, perhaps the calls happen > so rapidly that whatever discrete "time" source Reset uses is the same on each > call, thus setting G to the same state on each call. If I place a delay before each call of Roll, I get more different values, confirming this time/speed dependence of resetting the generator. > Ordinarily I would suggest to call Reset just once, and then let the state of > the generator evolve without Resets over all calls of Roll, but this cannot be > done here because G is a local variable in Roll, and it must be so since the > generic actual parameter depends on the Size parameter of Roll. OTOH, the Size parameter is fixed at 6, so subtype Die_Size and the generator could be placed outside Roll. Anyway, another nest will give suitable life times to the objects involved.