Search in sources :

Example 41 with AnalyzeTree

use of common.tree.AnalyzeTree in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch11.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch11(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
    int maxClearLine = 4;
    int maxDepth = 4;
    String marks = "" + "XXXX______" + "XXXXXXXXXX" + "XXXXX_____" + "XXXX_____X" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: myself 20170707
    assertThat(tree.getSuccessPercent()).isEqualTo(1758 / 2520.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 42 with AnalyzeTree

use of common.tree.AnalyzeTree in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch2BT4_5.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch2BT4_5(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p7");
    int maxClearLine = 6;
    int maxDepth = 7;
    String marks = "" + "XX________" + "XX________" + "XXX______X" + "XXXXXXX__X" + "XXXXXX___X" + "XXXXXXX_XX" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: myself 20170415
    assertThat(tree.getSuccessPercent()).isEqualTo(5038 / 5040.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Aggregations

AnalyzeTree (common.tree.AnalyzeTree)42 PatternGenerator (common.pattern.PatternGenerator)33 LoadedPatternGenerator (common.pattern.LoadedPatternGenerator)32 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)27 ArgumentsSource (org.junit.jupiter.params.provider.ArgumentsSource)27 Field (core.field.Field)10 MinoFactory (core.mino.MinoFactory)9 Test (org.junit.jupiter.api.Test)9 Action (common.datastore.action.Action)8 LockedCandidate (core.action.candidate.LockedCandidate)8 MinoShifter (core.mino.MinoShifter)8 MinoRotation (core.srs.MinoRotation)8 PerfectValidator (searcher.common.validator.PerfectValidator)8 Piece (core.mino.Piece)7 LongTest (module.LongTest)7 Pieces (common.datastore.blocks.Pieces)6 List (java.util.List)5 Pair (common.datastore.Pair)4 PermutationIterable (common.iterable.PermutationIterable)4 LongPieces (common.datastore.blocks.LongPieces)2