/** * Creates a pseudo random number generator (PRNG) for a experiment run that * generates uniform values between [min and max[. If it is to apply the * {@link #isApplyAntitheticVariatesTechnique() "Antithetic Variates Technique"} * to reduce results' variance, the second half of experiments will use the * seeds from the first half. * * @param experimentIndex index of the experiment run to create a PRNG * @param minValue the minimum value the generator will return (inclusive) * @param maxValue the maximum value the generator will return (exclusive) * @return the created PRNG * * @see UniformDistr#isApplyAntitheticVariates() */ protected ContinuousDistribution createRandomGen(final int experimentIndex, final double minValue, final double maxValue) { if (isToReuseSeedFromFirstHalfOfExperiments(experimentIndex)) { final int expIndexFromFirstHalf = experimentIndex - halfSimulationRuns(); return new UniformDistr(minValue, maxValue, seeds.get(expIndexFromFirstHalf)).setApplyAntitheticVariates(true); } return new UniformDistr(minValue, maxValue, seeds.get(experimentIndex)); }