Re: [math] inconsistent use of random generators

2010-11-17 Thread Phil Steitz
On 11/16/10 4:16 PM, Luc Maisonobe wrote: Hi all, Some of our algorithms do use random number generation. I quickly reviewed them and found different ways to use them. Genetic algorithm use a single static RandomGenerator shared by all instances. It default to JDKRandomGenerator and can be rese

Re: [math] inconsistent use of random generators

2010-11-17 Thread Ted Dunning
On Wed, Nov 17, 2010 at 12:19 AM, Luc Maisonobe wrote: > > In Mahout, we did this by having a static method in a utility class for > > getting a standard generator for either testing or normal operation. > This > > has turned out very well. > > It's a very good idea for production code, but I am

Re: [math] inconsistent use of random generators

2010-11-17 Thread Luc Maisonobe
Le 17/11/2010 02:14, Ted Dunning a écrit : > It is also desirable to have a way to inject a test generator so that test > cases can be made deterministic. Yes, this is what is done in the classes that already have a constructor argument, the tests do use it and use hard coded funny constants to se

Re: [math] inconsistent use of random generators

2010-11-16 Thread Ted Dunning
It is also desirable to have a way to inject a test generator so that test cases can be made deterministic. In Mahout, we did this by having a static method in a utility class for getting a standard generator for either testing or normal operation. This has turned out very well. +1 on using a be

Re: [math] inconsistent use of random generators

2010-11-16 Thread Gilles Sadowski
> [...] > > What about changing this to be more consistent ? +1 Obviously :-) > [...] Regards, Gilles - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org

[math] inconsistent use of random generators

2010-11-16 Thread Luc Maisonobe
Hi all, Some of our algorithms do use random number generation. I quickly reviewed them and found different ways to use them. Genetic algorithm use a single static RandomGenerator shared by all instances. It default to JDKRandomGenerator and can be reset by calling setRandomGenerator. Multi-star