Search in sources :

Example 1 with MappedBasicSolutions

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());
    }
}
Also used : PieceCounter(common.datastore.PieceCounter) ColumnField(core.column_field.ColumnField) BasicSolutionsCalculator(searcher.pack.solutions.BasicSolutionsCalculator) MappedBasicSolutions(searcher.pack.solutions.MappedBasicSolutions) BasicSolutions(searcher.pack.calculator.BasicSolutions) ColumnField(core.column_field.ColumnField) InOutPairField(searcher.pack.InOutPairField) Field(core.field.Field) SeparableMinos(searcher.pack.SeparableMinos) SizedBit(searcher.pack.SizedBit) Piece(core.mino.Piece) UsingBlockAndValidKeySolutionFilter(searcher.pack.memento.UsingBlockAndValidKeySolutionFilter) SolutionFilter(searcher.pack.memento.SolutionFilter) MappedBasicSolutions(searcher.pack.solutions.MappedBasicSolutions) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields)

Example 2 with MappedBasicSolutions

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);
}
Also used : SeparableMinos(searcher.pack.SeparableMinos) ColumnField(core.column_field.ColumnField) BasicSolutionsCalculator(searcher.pack.solutions.BasicSolutionsCalculator) MappedBasicSolutions(searcher.pack.solutions.MappedBasicSolutions) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields)

Example 3 with MappedBasicSolutions

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);
}
Also used : SeparableMinos(searcher.pack.SeparableMinos) ColumnField(core.column_field.ColumnField) BasicSolutionsCalculator(searcher.pack.solutions.BasicSolutionsCalculator) MappedBasicSolutions(searcher.pack.solutions.MappedBasicSolutions) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields)

Aggregations

ColumnField (core.column_field.ColumnField)3 SeparableMinos (searcher.pack.SeparableMinos)3 RecursiveMinoFields (searcher.pack.mino_fields.RecursiveMinoFields)3 BasicSolutionsCalculator (searcher.pack.solutions.BasicSolutionsCalculator)3 MappedBasicSolutions (searcher.pack.solutions.MappedBasicSolutions)3 PieceCounter (common.datastore.PieceCounter)1 Field (core.field.Field)1 Piece (core.mino.Piece)1 InOutPairField (searcher.pack.InOutPairField)1 SizedBit (searcher.pack.SizedBit)1 BasicSolutions (searcher.pack.calculator.BasicSolutions)1 SolutionFilter (searcher.pack.memento.SolutionFilter)1 UsingBlockAndValidKeySolutionFilter (searcher.pack.memento.UsingBlockAndValidKeySolutionFilter)1