@Test public void testWithNoSystematicGeneration() throws Exception { BigNTuples ntuples = new BigNTuplesGeneralSystematicFactory("1111|1111", new RectSize(4, 4), 2, -1, +1, new RotationMirrorSymmetryExpander(new RectSize(4,4)), false) .createRandomIndividual(new ThreadedRandom(0).forThread()); Assert.assertEquals(8, ntuples.getAll().size()); Assert.assertEquals(1, ntuples.getMain().size()); }
@Override public BigNTuples createRandomIndividual(RandomDataGenerator random) { BigNTuplesBuilder builder = new BigNTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); if (shiftToGenerateAll) { 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)); } } } else { for (BoardPosList positions : positionsList) { Preconditions.checkState(positions.fitOnBoard(boardSize)); builder.addTuple(positions.toLocations(boardSize)); } } return builder.buildNTuples(); }
BigNTuplesGeneralSystematicFactory implements IndividualFactory<BigNTuples> { @Override public BigNTuples createRandomIndividual(RandomDataGenerator random) { BigNTuplesBuilder builder = new BigNTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); if (shiftToGenerateAll) { 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)); } } } else { for (BoardPosList positions : positionsList) { Preconditions.checkState(positions.fitOnBoard(boardSize)); builder.addTuple(positions.toLocations(boardSize)); } } return builder.buildNTuples(); } }
BigNTuplesGeneralSystematicFactory implements IndividualFactory<BigNTuples> { @Override public BigNTuples createRandomIndividual(RandomDataGenerator random) { BigNTuplesBuilder builder = new BigNTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); if (shiftToGenerateAll) { 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)); } } } else { for (BoardPosList positions : positionsList) { Preconditions.checkState(positions.fitOnBoard(boardSize)); builder.addTuple(positions.toLocations(boardSize)); } } return builder.buildNTuples(); } BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander, boolean shiftToGenerateAll); }
BigNTuplesGeneralSystematicFactory implements IndividualFactory<BigNTuples> { @Override public BigNTuples createRandomIndividual(RandomDataGenerator random) { BigNTuplesBuilder builder = new BigNTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); if (shiftToGenerateAll) { 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)); } } } else { for (BoardPosList positions : positionsList) { Preconditions.checkState(positions.fitOnBoard(boardSize)); builder.addTuple(positions.toLocations(boardSize)); } } return builder.buildNTuples(); } BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander, boolean shiftToGenerateAll); @Override BigNTuples createRandomIndividual(RandomDataGenerator random); @Override String toString(); }
BigNTuplesGeneralSystematicFactory implements IndividualFactory<BigNTuples> { @Override public BigNTuples createRandomIndividual(RandomDataGenerator random) { BigNTuplesBuilder builder = new BigNTuplesBuilder(numValues, minWeight, maxWeight, expander, random, true); if (shiftToGenerateAll) { 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)); } } } else { for (BoardPosList positions : positionsList) { Preconditions.checkState(positions.fitOnBoard(boardSize)); builder.addTuple(positions.toLocations(boardSize)); } } return builder.buildNTuples(); } BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander);  BigNTuplesGeneralSystematicFactory(String patterns, RectSize boardSize, int numValues, double minWeight,
			double maxWeight, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(double minWeight, double maxWeight, String[] shapes, int numValues,
			RectSize boardSize, SymmetryExpander symmetryExpander, boolean shiftToGenerateAll); private  BigNTuplesGeneralSystematicFactory(BoardPosList[] positionsList, RectSize boardSize, int numValues,
			double minWeight, double maxWeight, SymmetryExpander expander, boolean shiftToGenerateAll); @Override BigNTuples createRandomIndividual(RandomDataGenerator random); @Override String toString();  }