Search in sources :

Example 16 with MinoShifter

use of core.mino.MinoShifter in project solution-finder by knewjade.

the class MappedBasicSolutionsTest method createSeparableMinos.

private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
Also used : MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter)

Example 17 with MinoShifter

use of core.mino.MinoShifter in project solution-finder by knewjade.

the class PackSearcherComparingParityBasedOnDemandTest method createSeparableMinos.

private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
Also used : MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter)

Example 18 with MinoShifter

use of core.mino.MinoShifter in project solution-finder by knewjade.

the class PackSearcherComparingParityBasedTest method createSeparableMinos.

private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
Also used : MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter)

Example 19 with MinoShifter

use of core.mino.MinoShifter in project solution-finder by knewjade.

the class LimitIterationCandidateTest method testSearch2.

@Test
void testSearch2() throws Exception {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    MinoRotation minoRotation = new MinoRotation();
    Candidate<Action> candidate = new LimitIterationCandidate(minoFactory, minoShifter, minoRotation, 3);
    String marks = "" + "XXXX______" + "XXXXX_____" + "X___X_____" + "XX_XX_____";
    Field field = FieldFactory.createField(marks);
    Set<Action> actions = candidate.search(field, Piece.T, 4);
    assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Spawn)).hasSize(3);
    assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Right)).hasSize(4);
    assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Reverse)).hasSize(4);
    assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Left)).hasSize(4);
}
Also used : MinoRotation(core.srs.MinoRotation) Field(core.field.Field) MinimalAction(common.datastore.action.MinimalAction) Action(common.datastore.action.Action) MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter) Test(org.junit.jupiter.api.Test) LongTest(module.LongTest)

Example 20 with MinoShifter

use of core.mino.MinoShifter in project solution-finder by knewjade.

the class LimitIterationCandidateTest method testSearch3When4Iteration.

@Test
void testSearch3When4Iteration() throws Exception {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    MinoRotation minoRotation = new MinoRotation();
    Candidate<Action> candidate = new LimitIterationCandidate(minoFactory, minoShifter, minoRotation, 4);
    String marks = "" + "XXXX______" + "XX_XXXXX__" + "X___X_____" + "XX_X______";
    Field field = FieldFactory.createField(marks);
    Set<Action> actions = candidate.search(field, Piece.T, 4);
    assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Spawn)).hasSize(3).contains(MinimalAction.create(8, 0, Rotate.Spawn)).contains(MinimalAction.create(7, 0, Rotate.Spawn)).contains(MinimalAction.create(6, 0, Rotate.Spawn)).doesNotContain(MinimalAction.create(5, 0, Rotate.Spawn));
}
Also used : MinoRotation(core.srs.MinoRotation) Field(core.field.Field) MinimalAction(common.datastore.action.MinimalAction) Action(common.datastore.action.Action) MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter) Test(org.junit.jupiter.api.Test) LongTest(module.LongTest)

Aggregations

MinoShifter (core.mino.MinoShifter)60 MinoFactory (core.mino.MinoFactory)59 MinoRotation (core.srs.MinoRotation)39 Field (core.field.Field)36 Test (org.junit.jupiter.api.Test)35 LongTest (module.LongTest)29 Action (common.datastore.action.Action)22 ColumnField (core.column_field.ColumnField)19 Piece (core.mino.Piece)19 InOutPairField (searcher.pack.InOutPairField)18 Randoms (lib.Randoms)17 LockedReachable (core.action.reachable.LockedReachable)15 LockedCandidate (core.action.candidate.LockedCandidate)14 PermutationIterable (common.iterable.PermutationIterable)12 List (java.util.List)10 Collectors (java.util.stream.Collectors)10 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)10 PerfectValidator (searcher.common.validator.PerfectValidator)10 SizedBit (searcher.pack.SizedBit)10 SolutionFilter (searcher.pack.memento.SolutionFilter)10