Re: [MATH][GENETICS][PR-199] Decision on use and customization of RNG functionality for randomization

2021-11-29 Thread Avijit Basak
Hi All Please see my comments: >The provider returned from ThreadLocalRandomSource.current(...) should >only be used within a single method. -- I missed the context of the thread in my previous mail. Sorry for the previous communication. We can only cache the RandomSource's enum value and

Re: [MATH][GENETICS][PR-199] Decision on use and customization of RNG functionality for randomization

2021-11-29 Thread Gilles Sadowski
Le lun. 29 nov. 2021 à 19:07, Alex Herbert a écrit : > > Note that your examples have incorrect usage of ThreadLocalRandomSource: The detailed explanation confirms what I hinted at previously: We should not use "ThreadLocalRandomSource" from within the library because we can easily do otherwise (

Re: [MATH][GENETICS][PR-199] Decision on use and customization of RNG functionality for randomization

2021-11-29 Thread Alex Herbert
Note that your examples have incorrect usage of ThreadLocalRandomSource: > > > > private IntegralValuedMutation(RandomSource rng) { > > provider = ThreadLocalRandomSource.current(rng); > > } The provider returned from ThreadLocalRandomSource.current(...) should only be used withi

Re: [MATH][GENETICS][PR-199] Decision on use and customization of RNG functionality for randomization

2021-11-29 Thread Gilles Sadowski
Hello. Le lun. 29 nov. 2021 à 07:05, Avijit Basak a écrit : > > Hi All > >Here is a sample use of two options. > > *Option1*: Declaring factory interface in MutationPolicy, CrossoverPolicy > and SelectionPolicy. A sample implementation has been shown here for > MutationPolicy. Similar wou