Print

Print


Hi Brandon, 

>  Math.-random() only gives you one thing, a double value 
> between zero and one, not including one. The Random class 
> provides a lot more functionality (such as the ability to seed it for
> reproducibility) so I would suggest you simply use it instead.
> Norman 

I completely agree with Norman that the java.util.Random class is the best thing to use. 

I don't know of any studies that show how good a random number generator java.util.Random is, I would guess that it is good enough for anything we are doing right now. If anyone has the time/interest it might be useful to compare it with the random number generators in the colt package

http://www-itg.lbl.gov/~hoschek/colt/api/cern/jet/random/engine/package-summary.html

which claim to be very good and fast.

Tony