public boolean reset() { if (seed == null) { return false; } normalDistribution.reseedRandomGenerator(seed); return true; }
public NormalDistributionInitializer(double mean, double standardDeviation) { this.seed = new Random().nextLong(); normalDistribution = new NormalDistribution(mean, standardDeviation); normalDistribution.reseedRandomGenerator(seed); }
public NormalDistributionInitializer() { this.seed = new Random().nextLong(); normalDistribution = new NormalDistribution(0, 0.0001); normalDistribution.reseedRandomGenerator(seed); }
@Override public void reseedRandomGenerator (long seed) { normalSampler.reseedRandomGenerator(seed); }
@Override public void reseedRandomGenerator (long seed) { normalSampler.reseedRandomGenerator(seed); }
private void ensureSeeds () { if (null == opSeed) { RandomSeedRepo repo = service.getRandomSeedRepo(); opSeed = repo.getRandomSeed( ColdStorage.class.getName() + "-" + name, 0, "model"); evalSeed = repo.getRandomSeed( ColdStorage.class.getName() + "-" + name, 0, "eval"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(opSeed.nextLong()); } }
private void ensureSeeds () { if (null == opSeed) { RandomSeedRepo repo = service.getRandomSeedRepo(); opSeed = repo.getRandomSeed( LiftTruck.class.getName() + "-" + name, 0, "model"); evalSeed = repo.getRandomSeed( LiftTruck.class.getName() + "-" + name, 0, "eval"); normal = new NormalDistribution(0.0, 1.0); normal.reseedRandomGenerator(opSeed.nextLong()); } }
public void init (BrokerProxy proxy, int seedId, RandomSeedRepo randomSeedRepo, TimeslotRepo timeslotRepo) { log.info("init(" + seedId + ") " + getUsername()); this.brokerProxyService = proxy; this.timeslotRepo = timeslotRepo; // set up the random generator this.seed = randomSeedRepo.getRandomSeed(CpGenco.class.getName(), seedId, "bid"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(seed.nextLong()); // set up the supply-curve generating function if (!function.validateCoefficients(coefficients)) log.error("wrong number of coefficients for quadratic"); int to = Competition.currentCompetition().getTimeslotsOpen(); timeslotCoefficients = new double[to][getCoefficients().size()]; }
@Test public void testKSTestCDF() { // Create theoretical distributions NormalDistribution stdNormalDist = new NormalDistribution(0, 1); // set seeds Long seed = 10L; stdNormalDist.reseedRandomGenerator(seed); Function<Double, Double> stdNormalCDF = (x) -> stdNormalDist.cumulativeProbability(x); double pThreshold = 0.05; // Comparing a standard normal sample to a standard normal distribution Row results = KolmogorovSmirnovTest .test(dataset, "sample", stdNormalCDF).head(); double pValue1 = results.getDouble(0); // Cannot reject null hypothesis assert(pValue1 > pThreshold); }
@Test public void testKSTestCDF() { // Create theoretical distributions NormalDistribution stdNormalDist = new NormalDistribution(0, 1); // set seeds Long seed = 10L; stdNormalDist.reseedRandomGenerator(seed); Function<Double, Double> stdNormalCDF = (x) -> stdNormalDist.cumulativeProbability(x); double pThreshold = 0.05; // Comparing a standard normal sample to a standard normal distribution Row results = KolmogorovSmirnovTest .test(dataset, "sample", stdNormalCDF).head(); double pValue1 = results.getDouble(0); // Cannot reject null hypothesis assert(pValue1 > pThreshold); }