@Test public void testRemovingDuplicates3Test() throws Exception { BoardPosList[] positionsList = { new BoardPosList("1111"), new BoardPosList("1000|0100|0010|0001"), new BoardPosList("111"), new BoardPosList("001|010|100"), new BoardPosList("11"), new BoardPosList("01|10"), new BoardPosList("1"), }; RectSize boardSize = new RectSize(4, 4); NTuples ntuples = new NTuplesGeneralSystematicFactory( positionsList, boardSize, 2, -1, +1, new RotationMirrorSymmetryExpander(boardSize)) .createRandomIndividual(new ThreadedRandom(0).forThread()); Assert.assertEquals(3+1+1, ntuples.getMain().size()); }
@Override public NTuples createRandomIndividual(RandomDataGenerator random) { NTuplesBuilder builder = new NTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addTuple(nextPositions.toLocations(boardSize)); } } return builder.buildNTuples(); }
NTuplesGeneralSystematicFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { NTuplesBuilder builder = new NTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addTuple(nextPositions.toLocations(boardSize)); } } return builder.buildNTuples(); } }
NTuplesGeneralSystematicFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { NTuplesBuilder builder = new NTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addTuple(nextPositions.toLocations(boardSize)); } } return builder.buildNTuples(); } NTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander);  NTuplesGeneralSystematicFactory(BoardPosList positions, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander); }
NTuplesGeneralSystematicFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { NTuplesBuilder builder = new NTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addTuple(nextPositions.toLocations(boardSize)); } } return builder.buildNTuples(); } NTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander);  NTuplesGeneralSystematicFactory(BoardPosList positions, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander); @Override NTuples createRandomIndividual(RandomDataGenerator random); @Override String toString(); }
NTuplesGeneralSystematicFactory implements IndividualFactory<NTuples> { @Override public NTuples createRandomIndividual(RandomDataGenerator random) { NTuplesBuilder builder = new NTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addTuple(nextPositions.toLocations(boardSize)); } } return builder.buildNTuples(); } NTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander);  NTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander);  NTuplesGeneralSystematicFactory(BoardPosList positions, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander); @Override NTuples createRandomIndividual(RandomDataGenerator random); @Override String toString();  }