use of common.pattern.PatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testSearch5.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch5(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("J, I, Z, *p4");
int maxClearLine = 4;
int maxDepth = 6;
String marks = "" + "________XX" + "XX_____XXX" + "XXX_____XX" + "XXX______X" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: myself 20170415
assertThat(tree.getSuccessPercent()).isEqualTo(180 / 840.0);
}
use of common.pattern.PatternGenerator in project solution-finder by knewjade.
the class CheckerNoHoldInvokerTest method testCase12.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testCase12(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
// Invoker
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p7");
int maxClearLine = 4;
int maxDepth = 6;
// Field
String marks = "" + "X_________" + "X___X_____" + "XXXXXXX___" + "XXXXXX____" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: reply in twitter from @fullfool_14
assertThat(tree.getSuccessPercent()).isEqualTo(727 / 5040.0);
}
use of common.pattern.PatternGenerator in project solution-finder by knewjade.
the class CheckerUsingHoldInvokerTest method testSearch1.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch1(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p7");
int maxClearLine = 8;
int maxDepth = 7;
String marks = "" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "XXXXXXXX__" + "XXXXXXXX__" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: myself 20170415
assertThat(tree.getSuccessPercent()).isEqualTo(5032 / 5040.0);
}
use of common.pattern.PatternGenerator in project solution-finder by knewjade.
the class CheckerUsingHoldInvokerTest method testSearch3.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch3(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p7");
int maxClearLine = 4;
int maxDepth = 6;
String marks = "" + "X_________" + "X___X_____" + "XXXXXXX___" + "XXXXXX____" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: myself 20170415
assertThat(tree.getSuccessPercent()).isEqualTo(4736 / 5040.0);
}
use of common.pattern.PatternGenerator in project solution-finder by knewjade.
the class CheckerUsingHoldInvokerTest method testSearch9.
@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch9(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
int maxClearLine = 4;
int maxDepth = 4;
String marks = "" + "XXXXXX____" + "XXXXX_____" + "XXXXXXX___" + "XXXXXX____" + "";
ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
// Source: twitter by @???
assertThat(tree.getSuccessPercent()).isEqualTo(1700 / 2520.0);
}
Aggregations