MachineGenerator mg = new MachineGenerator(states, 400 , (int)Math.round((double)states/5));mg.setGenerateConnected(true);
LearnerGraphND graph = mg.nextMachine(alphabet,-states, config, converter);
LearnerGraphND parsedOutcome = new LearnerGraphND(config);
StatechumProcess.parseStatemachine(StatechumProcess.constructFSM(graph), parsedOutcome, converter,true);
DifferentFSMException diffException = WMethod.checkM(graph, parsedOutcome);
Assert.assertNull(diffException);
Map<VertID,VertID> map = new TreeMap<VertID,VertID>();
for(int i=0;i<20;++i) map.put(graph.pathroutines.pickRandomState(rnd),graph.pathroutines.pickRandomState(rnd));
Map<VertID,VertID> mapOutcome = StatechumProcess.parseMap(StatechumProcess.mapToObject(map));
Assert.assertEquals(map,mapOutcome);
if (previous != null)
{
LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(graph,config);
OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(graph, previous, config);
DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
DifferentFSMException ex = WMethod.checkM(previous, shouldBeLikePrevious);
Assert.assertNull(ex);
}
previous = graph;
}
}