use of searcher.pack.solutions.MappedBasicSolutions in project solution-finder by knewjade.
the class PackSearcherComparingParityBasedTest method compareCount.
private void compareCount(int width, int height, List<TestData> testDataList) throws InterruptedException, ExecutionException {
SizedBit sizedBit = new SizedBit(width, height);
SeparableMinos separableMinos = createSeparableMinos(sizedBit);
BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
for (TestData data : testDataList) {
// 準備
List<Piece> usingPieces = data.getPieces();
int popCount = usingPieces.size();
Field initField = createSquareEmptyField(height, popCount);
// packで探索
Set<PieceCounter> pieceCounters = Collections.singleton(new PieceCounter(usingPieces));
SolutionFilter solutionFilter = createUsingBlockAndValidKeyMementoFilter(initField, sizedBit, pieceCounters);
BasicSolutions basicSolutions = new MappedBasicSolutions(calculate, solutionFilter);
long packCounter = calculateSRSValidCount(sizedBit, basicSolutions, initField, solutionFilter);
System.out.println(usingPieces);
assertThat(packCounter).isEqualTo(data.getCount());
}
}
use of searcher.pack.solutions.MappedBasicSolutions in project solution-finder by knewjade.
the class EasyPath method createMappedBasicSolutions.
private BasicSolutions createMappedBasicSolutions(SizedBit sizedBit) {
SeparableMinos separableMinos = SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
return new MappedBasicSolutions(calculate);
}
use of searcher.pack.solutions.MappedBasicSolutions in project solution-finder by knewjade.
the class PackSearcherTest method createMappedBasicSolutions.
private BasicSolutions createMappedBasicSolutions(SizedBit sizedBit) {
SeparableMinos separableMinos = SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
return new MappedBasicSolutions(calculate);
}
Aggregations