Search in sources :

Example 31 with SeparableMinos

use of searcher.pack.SeparableMinos in project solution-finder by knewjade.

the class PackSearcherTest method createOnDemandBasicSolutions.

private BasicSolutions createOnDemandBasicSolutions(SizedBit sizedBit) {
    SeparableMinos separableMinos = SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
    Predicate<ColumnField> memorizedPredicate = BasicSolutions.createBitCountPredicate(1);
    return new OnDemandBasicSolutions(separableMinos, sizedBit, memorizedPredicate);
}
Also used : FilterOnDemandBasicSolutions(searcher.pack.solutions.FilterOnDemandBasicSolutions) OnDemandBasicSolutions(searcher.pack.solutions.OnDemandBasicSolutions) SeparableMinos(searcher.pack.SeparableMinos) ColumnField(core.column_field.ColumnField)

Example 32 with SeparableMinos

use of searcher.pack.SeparableMinos in project solution-finder by knewjade.

the class PackSearcherTest method createFilterOnDemandBasicSolutions.

private BasicSolutions createFilterOnDemandBasicSolutions(SizedBit sizedBit, ColumnSmallField field, SolutionFilter solutionFilter) {
    SeparableMinos separableMinos = SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
    Predicate<ColumnField> memorizedPredicate = BasicSolutions.createBitCountPredicate(1);
    return new FilterOnDemandBasicSolutions(separableMinos, sizedBit, field, memorizedPredicate, solutionFilter);
}
Also used : SeparableMinos(searcher.pack.SeparableMinos) ColumnField(core.column_field.ColumnField) FilterOnDemandBasicSolutions(searcher.pack.solutions.FilterOnDemandBasicSolutions)

Example 33 with SeparableMinos

use of searcher.pack.SeparableMinos in project solution-finder by knewjade.

the class PathEntryPoint method calculateBasicSolutions.

private BasicSolutions calculateBasicSolutions(Field field, MinoFactory minoFactory, MinoShifter minoShifter, SizedBit sizedBit, SolutionFilter solutionFilter) throws FinderInitializeException {
    // ミノのリストを作成する
    SeparableMinos separableMinos = SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
    // 基本パターンを計算
    int cachedMinBit = settings.getCachedMinBit();
    Predicate<ColumnField> predicate = createPredicate(cachedMinBit);
    ColumnSmallField maxOuterBoard = InOutPairField.createMaxOuterBoard(sizedBit, field);
    return new FilterOnDemandBasicSolutions(separableMinos, sizedBit, maxOuterBoard, predicate, solutionFilter);
}
Also used : ColumnSmallField(core.column_field.ColumnSmallField) SeparableMinos(searcher.pack.SeparableMinos) ColumnField(core.column_field.ColumnField) EntryPoint(entry.EntryPoint) FilterOnDemandBasicSolutions(searcher.pack.solutions.FilterOnDemandBasicSolutions)

Aggregations

ColumnField (core.column_field.ColumnField)33 SeparableMinos (searcher.pack.SeparableMinos)33 SizedBit (searcher.pack.SizedBit)21 Test (org.junit.jupiter.api.Test)18 MinoFactory (core.mino.MinoFactory)13 MinoShifter (core.mino.MinoShifter)13 Field (core.field.Field)12 Predicate (java.util.function.Predicate)12 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)12 RecursiveMinoFields (searcher.pack.mino_fields.RecursiveMinoFields)12 Stream (java.util.stream.Stream)10 SeparableMino (searcher.pack.separable_mino.SeparableMino)10 OnDemandBasicSolutions (searcher.pack.solutions.OnDemandBasicSolutions)10 InOutPairField (searcher.pack.InOutPairField)9 BasicSolutions (searcher.pack.calculator.BasicSolutions)9 SolutionFilter (searcher.pack.memento.SolutionFilter)9 Piece (core.mino.Piece)7 Result (searcher.pack.task.Result)7 TaskResultHelper (searcher.pack.task.TaskResultHelper)7 LockedReachableThreadLocal (concurrent.LockedReachableThreadLocal)6