@Test public void testSeedConsidering() { DiscreteRandomProducer producer1 = new DiscreteRandomProducer(0L, 0.1, 0.2, 0.3, 0.4); DiscreteRandomProducer producer2 = new DiscreteRandomProducer(0L, 0.1, 0.2, 0.3, 0.4); assertEquals(producer1.get(), producer2.get(), 0.0001); }
@Override public Double get() { double p = generator().nextDouble(); for (int i = 0; i < probs.length; i++) { if (probs[i] > p) return (double)ids[i]; } return (double)ids[probs.length - 1]; }
DiscreteRandomProducer extends RandomProducerWithGenerator { @Override public Double get() { double p = generator().nextDouble(); for (int i = 0; i < probs.length; i++) { if (probs[i] > p) return (double)ids[i]; } return (double)ids[probs.length - 1]; } }
DiscreteRandomProducer extends RandomProducerWithGenerator { @Override public Double get() { double p = generator().nextDouble(); for (int i = 0; i < probs.length; i++) { if (probs[i] > p) return (double)ids[i]; } return (double)ids[probs.length - 1]; } DiscreteRandomProducer(double... probs);  DiscreteRandomProducer(long seed, double... probs); }
DiscreteRandomProducer extends RandomProducerWithGenerator { @Override public Double get() { double p = generator().nextDouble(); for (int i = 0; i < probs.length; i++) { if (probs[i] > p) return (double)ids[i]; } return (double)ids[probs.length - 1]; } DiscreteRandomProducer(double... probs);  DiscreteRandomProducer(long seed, double... probs); static DiscreteRandomProducer uniform(int numOfValues); static DiscreteRandomProducer uniform(int numOfValues, long seed); static double[] randomDistribution(int numOfValues); static double[] randomDistribution(int numOfValues, long seed); @Override Double get(); int getInt(); int size(); }
DiscreteRandomProducer extends RandomProducerWithGenerator { @Override public Double get() { double p = generator().nextDouble(); for (int i = 0; i < probs.length; i++) { if (probs[i] > p) return (double)ids[i]; } return (double)ids[probs.length - 1]; } DiscreteRandomProducer(double... probs);  DiscreteRandomProducer(long seed, double... probs); static DiscreteRandomProducer uniform(int numOfValues); static DiscreteRandomProducer uniform(int numOfValues, long seed); static double[] randomDistribution(int numOfValues); static double[] randomDistribution(int numOfValues, long seed); @Override Double get(); int getInt(); int size();  }