Thanks, Brent.
As I write up the docs, I am thinking about adding one more thing,
which I would apprecate feedback on.  I mentioned above that the
RandomGenerator / AbstractRandomGenerator provided a generic facility
for replacing java.util.random.  Recompilation is still required,
however, to use this.  I am thinking now that it might be useful to
add a class that *extends* java.util.Random to wrap a RandomGenerator
to make it possible to do this in a binary compatible way.  Does this
make sense?

Phil

On 5/21/05, Brent Worden <[EMAIL PROTECTED]> wrote:
> The implementation looks good an a lot less heftier than what I was
> anticipating.
> 
> Good work,
> 
> Brent Worden
> 
> > -----Original Message-----
> > From: Phil Steitz [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, May 15, 2005 1:39 PM
> > To: Jakarta Commons Developers List
> > Subject: Re: [math] Making PRNG pluggable in o.a.c.m.random classes
> >
> > I committed the changes described above.  Feedback welcome.
> > I tested adapting and integration a RngPack generator.
> > Adaptor for Mersenne Twister looks like this (base adaptor
> > for all RngPack generators would be similar):
> >
> > /**
> >  * AbstractRandomGenerator based on RngPack RanMT generator.
> >  */
> > public class TestRngPackGenerator extends AbstractRandomGenerator {
> >
> >     private RanMT random = new RanMT();
> >
> >     public void setSeed(long seed) {
> >        random = new RanMT(seed);
> >     }
> >
> >     public double nextDouble() {
> >         return random.raw();
> >     }
> >
> >     public double nextGaussian() {
> >         return random.gaussian();
> >     }
> >
> >     public int nextInt(int n) {
> >         return random.choose(n);
> >     }
> >
> >     public boolean nextBoolean() {
> >         return random.coin();
> >     }
> > }
> >
> > I will update the user guide to include this and other
> > examples assuming all are OK with these changes.
> >
> > Phil
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to