Search in sources :

Example 6 with RecursiveMinoFields

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

the class BasicSolutionsCalculator method addColumnSmallField.

private void addColumnSmallField(ColumnSmallField basicField) {
    Field wallField = createWallField(basicField);
    ColumnSmallField initOuterField = ColumnFieldFactory.createField();
    RecursiveMinoFields calculate = calculate(basicField, initOuterField, wallField);
    resultsMap.put(basicField, calculate);
}
Also used : ColumnField(core.column_field.ColumnField) SmallField(core.field.SmallField) Field(core.field.Field) ColumnSmallField(core.column_field.ColumnSmallField) ColumnSmallField(core.column_field.ColumnSmallField) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) MemorizedRecursiveMinoFields(searcher.pack.mino_fields.MemorizedRecursiveMinoFields) OnDemandRecursiveMinoFields(searcher.pack.mino_fields.OnDemandRecursiveMinoFields)

Example 7 with RecursiveMinoFields

use of searcher.pack.mino_fields.RecursiveMinoFields 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 8 with RecursiveMinoFields

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

the class MappedBasicSolutionsTest method get3x5.

@Test
void get3x5() throws Exception {
    SizedBit sizedBit = new SizedBit(3, 5);
    SeparableMinos separableMinos = createSeparableMinos(sizedBit);
    BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
    Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
    BasicSolutions solutions = new MappedBasicSolutions(calculate);
    MinoFields minoFields = solutions.parse(ColumnFieldFactory.createField());
    Stream<? extends MinoField> stream = minoFields.stream();
    assertThat(stream.count()).isEqualTo(260179L);
}
Also used : RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) MinoFields(searcher.pack.mino_fields.MinoFields) SeparableMinos(searcher.pack.SeparableMinos) SizedBit(searcher.pack.SizedBit) ColumnField(core.column_field.ColumnField) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) BasicSolutions(searcher.pack.calculator.BasicSolutions) Test(org.junit.jupiter.api.Test)

Example 9 with RecursiveMinoFields

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

the class MappedBasicSolutionsTest method get2x4.

@Test
void get2x4() throws Exception {
    SizedBit sizedBit = new SizedBit(2, 4);
    SeparableMinos separableMinos = createSeparableMinos(sizedBit);
    BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
    Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
    BasicSolutions solutions = new MappedBasicSolutions(calculate);
    MinoFields minoFields = solutions.parse(ColumnFieldFactory.createField());
    Stream<? extends MinoField> stream = minoFields.stream();
    assertThat(stream.count()).isEqualTo(1239L);
}
Also used : RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) MinoFields(searcher.pack.mino_fields.MinoFields) SeparableMinos(searcher.pack.SeparableMinos) SizedBit(searcher.pack.SizedBit) ColumnField(core.column_field.ColumnField) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) BasicSolutions(searcher.pack.calculator.BasicSolutions) Test(org.junit.jupiter.api.Test)

Example 10 with RecursiveMinoFields

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

the class MappedBasicSolutionsTest method get2x5.

@Test
void get2x5() throws Exception {
    SizedBit sizedBit = new SizedBit(2, 5);
    SeparableMinos separableMinos = createSeparableMinos(sizedBit);
    BasicSolutionsCalculator calculator = new BasicSolutionsCalculator(separableMinos, sizedBit);
    Map<ColumnField, RecursiveMinoFields> calculate = calculator.calculate();
    BasicSolutions solutions = new MappedBasicSolutions(calculate);
    MinoFields minoFields = solutions.parse(ColumnFieldFactory.createField());
    Stream<? extends MinoField> stream = minoFields.stream();
    assertThat(stream.count()).isEqualTo(19375L);
}
Also used : RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) MinoFields(searcher.pack.mino_fields.MinoFields) SeparableMinos(searcher.pack.SeparableMinos) SizedBit(searcher.pack.SizedBit) ColumnField(core.column_field.ColumnField) RecursiveMinoFields(searcher.pack.mino_fields.RecursiveMinoFields) BasicSolutions(searcher.pack.calculator.BasicSolutions) Test(org.junit.jupiter.api.Test)

Aggregations

ColumnField (core.column_field.ColumnField)12 RecursiveMinoFields (searcher.pack.mino_fields.RecursiveMinoFields)12 SeparableMinos (searcher.pack.SeparableMinos)11 SizedBit (searcher.pack.SizedBit)7 BasicSolutions (searcher.pack.calculator.BasicSolutions)7 Test (org.junit.jupiter.api.Test)6 MinoFields (searcher.pack.mino_fields.MinoFields)6 Field (core.field.Field)3 BasicSolutionsCalculator (searcher.pack.solutions.BasicSolutionsCalculator)3 MappedBasicSolutions (searcher.pack.solutions.MappedBasicSolutions)3 OperationWithKey (common.datastore.OperationWithKey)1 PieceCounter (common.datastore.PieceCounter)1 ColumnSmallField (core.column_field.ColumnSmallField)1 SmallField (core.field.SmallField)1 Piece (core.mino.Piece)1 List (java.util.List)1 Objects (java.util.Objects)1 Callable (java.util.concurrent.Callable)1 Stream (java.util.stream.Stream)1 Stopwatch (lib.Stopwatch)1