@Test public void testGet() { VectorGeneratorsFamily family = new VectorGeneratorsFamily.Builder() .add(() -> VectorUtils.of(0.)) .add(() -> VectorUtils.of(1.)) .add(() -> VectorUtils.of(2.)) .build(0L); Set<Double> validValues = DoubleStream.of(0., 1., 2.).boxed().collect(Collectors.toSet()); for (int i = 0; i < 100; i++) { Vector vector = family.get(); assertTrue(validValues.contains(vector.get(0))); } }
@Override public Vector get() { return family.get(selector.getInt()).get(); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); @Override Vector get(); VectorWithDistributionId getWithId(); @Override DataStreamGenerator asDataStream(); }
VectorGeneratorsFamily implements VectorGenerator { @Override public Vector get() { return family.get(selector.getInt()).get(); } private  VectorGeneratorsFamily(List<VectorGenerator> family, DiscreteRandomProducer selector); @Override Vector get(); VectorWithDistributionId getWithId(); @Override DataStreamGenerator asDataStream();  }