@Test public void testCreateRandomIndividual() throws Exception { NTuplesAllStraightFactory factory = new NTuplesAllStraightFactory( 2, new RectSize(3), 2, -1, 1, new RotationMirrorSymmetryExpander(new RectSize(3))); NTuples ntuples = factory.createRandomIndividual(new RandomDataGenerator()); Assert.assertEquals(4, ntuples.getMain().size()); Assert.assertEquals(24, ntuples.getAll().size()); HashSet<IntArrayList> set = new HashSet<>(); for (NTuple t : ntuples.getAll()) { IntArrayList loc = IntArrayList.from(t.getLocations()); Assert.assertFalse(set.contains(loc)); set.add(loc); for (int p : t.getLocations()) { Assert.assertTrue(BoardUtils.isValidPosition(p, 3)); } } }
@Override public NTuples createRandomIndividual(RandomDataGenerator random) { return genericFactory.createRandomIndividual(random); }
NTuplesAllStraightFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { return genericFactory.createRandomIndividual(random); } }
NTuplesAllStraightFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { return genericFactory.createRandomIndividual(random); } NTuplesAllStraightFactory(int tupleLength, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander expander); }
NTuplesAllStraightFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { return genericFactory.createRandomIndividual(random); } NTuplesAllStraightFactory(int tupleLength, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander expander); @Override NTuples createRandomIndividual(RandomDataGenerator random); @Override String toString(); }
NTuplesAllStraightFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { return genericFactory.createRandomIndividual(random); } NTuplesAllStraightFactory(int tupleLength, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander expander); @Override NTuples createRandomIndividual(RandomDataGenerator random); @Override String toString();  }