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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Not intended for use in medical, Date: 1997/05/18 Message-ID: <01bc63a2$e3e1a940$LocalHost@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 242998819 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com><01bc6006$c13cf880$LocalHost@xhv46.dial.pipex.com><01bc6182$30e3a7c0$LocalHost@xhv46.dial.pipex.com> Organization: UUNet PIPEX server (post doesn't reflect views of UUNet PIPEX) Newsgroups: comp.lang.ada Date: 1997-05-18T00:00:00+00:00 List-Id: Robert I. Eachus wrote in article some interesting observations about multiple random number generators. Many thanks for the replies I've had to this post. I did indeed have a serious misunderstanding of the purity of packages. I see my mistake: an impure package cannot have a pure child (not the other way around). I've had another close look at the Float_Random and Discrete_Random packages in the RM. I think I see what people are driving at about having to use the heap (or 'a heap'). I was thinking that one could implement the type Generator as a general access type (in fact a controlled type with a general access component), and then have just one generator declared directly in the package body, and cause all objects of type Generator to point to it. However, this would violate the independence of the generators, something which the standard insists on. It is interesting to note that if a program creates many generators seeded by the clock all at (very nearly) the same time, it runs the risk (depending on the resolution of the clock) of all those generators (or many of them) being seeded with the same seeds, and therefore generating exactly the same sequences of numbers. It is on this issue which Robert Eachus was writing (I think). Are there any practical situations where this might be a problem? Additionally, are there any practical situations where the fact that the standard random packages must be implemented using the heap is a significant problem? Once again, very many thanks for the replies, which I have found most illuminating. Nick.