for(String [] path:plus)
assert AbstractOracle.USER_ACCEPTED == expected.paths.tracePathPrefixClosed(Arrays.asList(path));
for(String [] path:minus)
assert AbstractOracle.USER_ACCEPTED != expected.paths.tracePathPrefixClosed(Arrays.asList(path));
// Visualiser.getVisualiser()
Learner l = new RPNIUniversalLearner(null,new LearnerEvaluationConfiguration(null,null,testConfig,null,null))
{
@Override
public Pair<Integer,String> CheckWithEndUser(
@SuppressWarnings("unused") LearnerGraph model,
List<String> question, @SuppressWarnings("unused") int valueForNoRestart,
@SuppressWarnings("unused") List<Boolean> acceptedElements,
@SuppressWarnings("unused") final Object [] moreOptions)
{
return new Pair<Integer,String>(expected.paths.tracePathPrefixClosed(question),null);
}
};
config.setDebugMode(false);
//l.setPairsMergedPerHypothesis(0);
//l.setGeneralisationThreshold(1);
//l.setCertaintyThreshold(5);
testConfig.setLearnerIdMode(IDMode.POSITIVE_NEGATIVE);
LearnerGraph learntStructureA = new LearnerGraph(l.learnMachine(buildSet(plus), buildSet(minus)),expected.config);
// Now do the same with ptasets instead of real sets
PTASequenceSet plusPTA = new PTASequenceSet();plusPTA.addAll(buildSet(plus));PTASequenceSet minusPTA = new PTASequenceSet();minusPTA.addAll(buildSet(minus));
LearnerGraph learntStructureB = new LearnerGraph(l.learnMachine(plusPTA, minusPTA),expected.config);
Assert.assertNull(WMethod.checkM(learntStructureA, learntStructureB));
LearnerGraph learntMachineNoRejects = new LearnerGraph(expected.config);
AbstractPathRoutines.removeRejectStates(learntStructureA,learntMachineNoRejects);
Assert.assertNull(WMethod.checkM(learntMachineNoRejects, expected));
}