comp.lang.ada
 help / color / mirror / Atom feed
* Ada2005 random
@ 2003-04-02 13:27 Peter Hermann
  2003-04-02 13:44 ` Lutz Donnerhacke
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Peter Hermann @ 2003-04-02 13:27 UTC (permalink / raw)


In an application I need a variable discrete random function.

Due to good reason I am reluctant to use my own very old
http://www.csv.ica.uni-stuttgart.de/ftp/pub/ada/ica/misc/randomph.txt

Instead, I would prefer to use
generic
   type Result_Subtype is (<>);
package Ada.Numerics.Discrete_Random is

which offers a
   function Random (Gen : Generator) return Result_Subtype;

but does not offer something like
   function Random (Gen : Generator;
                    from : Result_Subtype := Result_Subtype'first;
                     to  : Result_Subtype := Result_Subtype'last)
                                      return Result_Subtype;
which may or may not make sense in that raw disguise.

Anyway in Ada95, I have to roll my own code or let me send one ;-)

Does an AI exist for Ada95 or Ada2005?
Did I miss something?

-- 
--Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
--Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
--http://www.csv.ica.uni-stuttgart.de/homes/ph/
--Team Ada: "C'mon people let the world begin" (Paul McCartney)



^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: Ada2005 random
@ 2003-04-03 12:27 David C. Hoos, Sr.
  2003-04-03 12:39 ` Peter Hermann
  0 siblings, 1 reply; 32+ messages in thread
From: David C. Hoos, Sr. @ 2003-04-03 12:27 UTC (permalink / raw)
  To: comp.lang.ada mail to news gateway; +Cc: ica2ph


----- Original Message ----- 
From: "Peter Hermann" <ica2ph@sinus.csv.ica.uni-stuttgart.de>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: April 03, 2003 3:56 AM
Subject: Re: Ada2005 random


> Lutz and all,
> > * Peter Hermann wrote:
> >> In an application I need a variable discrete random function.
>                               ^^^^^^^^
> with "variable" I meant the following flexibility,  e.g. :
>                   a := random(generator1, 1 , 9);
>                   b := random(generator1, 1 , 8);
>                   c := random(generator1, 3 , 7);
Such an approach is statistcally dubious, since the same generator is
being used for all draws.  Normally, one would use a distinct
generator for each sequence.

> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
> 
> 




^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2003-04-13 21:58 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-02 13:27 Ada2005 random Peter Hermann
2003-04-02 13:44 ` Lutz Donnerhacke
2003-04-03  9:56   ` Peter Hermann
2003-04-03 10:13     ` Lutz Donnerhacke
2003-04-04  3:50 ` Steve
2003-04-04 14:30   ` Lutz Donnerhacke
2003-04-05  3:02     ` Steve
2003-04-04  4:33 ` Christoph Grein
2003-04-06 15:44   ` 
2003-04-05  0:14 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2003-04-03 12:27 David C. Hoos, Sr.
2003-04-03 12:39 ` Peter Hermann
2003-04-03 22:10   ` Randy Brukardt
2003-04-04  7:43     ` Peter Hermann
2003-04-04 10:21     ` Dale Stanbrough
2003-04-04 12:11       ` Stuart Palin
2003-04-04 14:25       ` Lutz Donnerhacke
2003-04-04 21:51         ` Dale Stanbrough
2003-04-05 18:34           ` Samuel Tardieu
2003-04-05  6:46       ` Martin Krischik
2003-04-07 21:07         ` Randy Brukardt
2003-04-13 14:56       ` Robert I. Eachus
2003-04-13 21:58         ` Mark Biggar
2003-04-04 12:20     ` Stuart Palin
2003-04-07  7:26       ` Jean-Etienne Doucet
2003-04-07  8:09         ` Lutz Donnerhacke
2003-04-04  8:27   ` 
2003-04-04 12:14     ` Peter Hermann
2003-04-04 14:26       ` Lutz Donnerhacke
     [not found]     ` <6lk1m-lm3.ln1@beastie.ix.netcom.com>
2003-04-05  7:29       ` Pascal Obry
2003-04-05  9:00         ` tmoran
2003-04-05 17:02           ` Pascal Obry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox