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);
}
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);
}
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);
}
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);
}
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));
}
Aggregations