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-start optimizers use a separate RandomGenerator for each instance, set by a constructor argument. NaturalRanking use either a RandomDataImpl which is itself either based on a RandomGenerator constructor argument or a JDKRandomGenerator by default if the user did not provide a generator. Kmeans++ use directly a java.util.Random instance provided as a constructor argument (only this class can be used, none of our generators can be used here). What about changing this to be more consistent ? I would like to have all our algorithms use the RandomGenerator interface, thus allowing the user to put the generator more suited to their needs (it can be the JDK one or a better one like Mersenne-Twister or one of the WELL generators). I would also like to have one generator for each instance set up at construction time. I also think JDKRandomGenerator is probably not a good default and one of the more modern generators we now have could be used like Well19937c. Luc --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org