Hi. Le sam. 27 avr. 2019 à 15:05, Alex Herbert <alex.d.herb...@gmail.com> a écrit : > > I have created RNG-97 and RNG-98 for Jump and LongJump. > > Please take a look and comment. > > The documentation highlights the implementation detail that a jump or long > jump creates a copy that is far ahead. The original generator is not effected. > > The use case is thus: > > rng1 = …; > rng2 = rng1.jump(); > rng3 = rng2.jump(); > rng4 = rng3.jump(); > > As opposed to: > > rng1 = …; > rng2 = rng1.jump(); > rng3 = rng1.jump(); > rng4 = rng1.jump(); > > Where rng1 will be advanced each time leaving behind a copy generator. > > In either case it will be an overlap problem if any of the children are then > used for jumping. So as long as the documentation is clear then this is OK. > The helper method to create a jump series (or long jump series) in > RandomSource seems the best way to avoid incorrect usage.
+1 I think that the default should be to prevent a "jump" on the returned instances. An overload could be defined with a parameter (e.g. "allowFurtherJump") but I'd leave it out until it is requested based on an actual use-case. Best, Gilles > > Alex --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org