use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testCase11.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testCase11(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
// Invoker
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p4");
int maxClearLine = 5;
int maxDepth = 4;
// Field
String marks = "" + "____XXXXXX" + "____XXXXXX" + "___XXXXXXX" + "__XXXXXXXX" + "___XXXXXXX" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: reply in twitter from @fullfool_14
assertThat(tree.getSuccessPercent()).isEqualTo(477 / 2520.0);
}
use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testSearch10.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch10(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p7");
int maxClearLine = 4;
int maxDepth = 6;
// Field
String marks = "" + "X________X" + "X________X" + "XX______XX" + "XXXXXX__XX" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: reply in twitter from @fullfool_14
assertThat(tree.getSuccessPercent()).isEqualTo(1439 / 5040.0);
}
use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testSearch8.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch8(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
int maxClearLine = 4;
int maxDepth = 4;
String marks = "" + "XXXXXX____" + "XXXXX_____" + "XXXXXX____" + "XXXXXXX___" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: twitter by @???
assertThat(tree.getSuccessPercent()).isEqualTo(609 / 2520.0);
}
use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testCase14.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testCase14(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
// Invoker
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
int maxClearLine = 4;
int maxDepth = 4;
// Field
String marks = "" + "XXXX______" + "XXXX_____X" + "XXXXXXXXXX" + "XXXX_____X" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: myself 20170415
assertThat(tree.getSuccessPercent()).isEqualTo(309 / 2520.0);
}
use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.
the class CheckerUsingHoldInvokerTest method testSearch7.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch7(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
int maxClearLine = 4;
int maxDepth = 4;
String marks = "" + "XXXXX_____" + "XXXXXX____" + "XXXXXXX___" + "XXXXXX____" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: twitter by @???
assertThat(tree.getSuccessPercent()).isEqualTo(1672 / 2520.0);
}
Aggregations