/** Tests non-deterministic case of {@link MarkovClassifier#tracePath}, deterministic case is tested with {@link TestPathTracing}. */
@Test
public void testTracePath5()
{
final LearnerGraph fsm = FsmParser.buildLearnerGraph("A-t->B-b->C", "testTracePath1",config,converter);
LearnerGraphND ndFSM = new LearnerGraphND(fsm,config);
CmpVertex Brej=null;
synchronized(AbstractLearnerGraph.syncObj)
{
ndFSM.addVertex(ndFSM.addVertex(ndFSM.addVertex(ndFSM.addVertex(fsm.findVertex("B"), true, lblA),true,lblA),true,lblA),true,lblA);
ndFSM.addVertex(ndFSM.addVertex(ndFSM.addVertex(fsm.findVertex("B"), true, lblA),true,lblA),false,lblC);
Brej=ndFSM.addVertex(ndFSM.addVertex(fsm.findVertex("B"), true, lblA),false,lblB);
ndFSM.addVertex(Brej,false,lblC);
}
Assert.assertEquals(13,ndFSM.getStateNumber());
Assert.assertTrue(MarkovClassifier.tracePath(ndFSM,AbstractLearnerGraph.buildList(Arrays.asList(new String[]{}),config,converter),fsm.findVertex("A")));
Assert.assertTrue(MarkovClassifier.tracePath(ndFSM,AbstractLearnerGraph.buildList(Arrays.asList(new String[]{"t","b"}),config,converter),fsm.findVertex("A")));
Assert.assertTrue(MarkovClassifier.tracePath(ndFSM,AbstractLearnerGraph.buildList(Arrays.asList(new String[]{"t","a","a","a"}),config,converter),fsm.findVertex("A")));
Assert.assertTrue(MarkovClassifier.tracePath(ndFSM,AbstractLearnerGraph.buildList(Arrays.asList(new String[]{"t","a","a","a","a"}),config,converter),fsm.findVertex("A")));
Assert.assertFalse(MarkovClassifier.tracePath(ndFSM,AbstractLearnerGraph.buildList(Arrays.asList(new String[]{"t","a","a","c"}),config,converter),fsm.findVertex("A")));