use of core.column_field.ColumnSmallField in project solution-finder by knewjade.
the class InOutPairFieldTest method createMaxOuterBoard2x5_2.
@Test
void createMaxOuterBoard2x5_2() {
Field field = FieldFactory.createField("" + "___XX_XXXX" + "XXXXX_XXXX" + "_XXX_XXX_X" + "__XXXXXXXX" + "X_XXXXXXXX");
int width = 2;
int height = 5;
SizedBit sizedBit = new SizedBit(width, height);
ColumnSmallField maxOuterBoard = InOutPairField.createMaxOuterBoard(sizedBit, field);
ColumnSmallField expects = ColumnFieldFactory.createField("" + "____X" + "__X_X" + "___X_" + "__XXX" + "__XXX", height);
assertThat(maxOuterBoard).isEqualTo(expects);
}
use of core.column_field.ColumnSmallField in project solution-finder by knewjade.
the class InOutPairFieldTest method createInOutPairFields2x5.
@Test
void createInOutPairFields2x5() {
Field field = FieldFactory.createField("" + "____X___X_" + "___X___XX_" + "__X___XX_X" + "_X___XX__X" + "X____X___X");
int width = 2;
int height = 5;
SizedBit sizedBit = new SizedBit(width, height);
// Create pairs
List<InOutPairField> fields = InOutPairField.createInOutPairFields(sizedBit, field);
assertThat(fields).hasSize(4);
// Check inner
ColumnSmallField innerField1 = ColumnFieldFactory.createField("" + "__" + "__" + "__" + "_X" + "X_", height);
ColumnSmallField innerField2 = ColumnFieldFactory.createField("" + "__" + "_X" + "X_" + "__" + "__", height);
ColumnSmallField innerField3 = ColumnFieldFactory.createField("" + "X_" + "__" + "__" + "_X" + "_X", height);
ColumnSmallField innerField4 = ColumnFieldFactory.createField("" + "__" + "_X" + "XX" + "X_" + "__", height);
assertThat(fields.stream().map(InOutPairField::getInnerField)).containsExactly(innerField1, innerField2, innerField3, innerField4);
// Check outer
ColumnSmallField outerField1 = ColumnFieldFactory.createField("" + "_____" + "___X_" + "__X__" + "_____" + "_____", height);
ColumnSmallField outerField2 = ColumnFieldFactory.createField("" + "__X__" + "_____" + "_____" + "___X_" + "___X_", height);
ColumnSmallField outerField3 = ColumnFieldFactory.createField("" + "_____" + "___X_" + "__XX_" + "__X__" + "_____", height);
ColumnSmallField outerField4 = ColumnFieldFactory.createField("" + "__X_X" + "__X_X" + "___XX" + "___XX" + "___XX", height);
assertThat(fields.stream().map(InOutPairField::getOuterField)).containsExactly(outerField1, outerField2, outerField3, outerField4);
}
use of core.column_field.ColumnSmallField 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);
}
Aggregations