On Sun, Jan 17, 2010 at 10:31 PM, Benson Margulies
<bimargul...@gmail.com> wrote:
> Have a look at the patch I posted to MAHOUT-260. It ducks the
> injection question for now.

This looks reasonable.

> However, what's perhaps most interesting is that it makes tests fail!
> Some tests get different answers with the stock JDK rng.

Which tests are failing? I'm having some issues with non-patched head ATM.

> If we want to go in Drew's suggested direction, we have to decide what
> to do about seeds. We either need to define an
> 'RandomNumberGeneratorFactory' interface which takes seeds and return
> generators, or we want to inject Random objects and expect the
> injector to worry about constructing and dealing with seeds.

I vote for the latter. Those Random objects could be created via a
factory by whomever is injecting them.

FWIW, RandomNumberGeneratorFactory pretty much exists today as
RandomUtils, I suspect we would just want to get rid of the static
boolean that determines whether a test seed or random seed is used for
getRandom().

Reply via email to