runTestCompute_ND3(Configuration argConfig, int expectedKeyPairs, int threadNumber, final ConvertALabel converter)
{
final String name = "testComputeGD_ND2";
Configuration cloneConfig = argConfig.copy();cloneConfig.setLearnerCloneGraph(true);
String common = "A-a->B-p->B\nA-a->C-q->C\nA-a->D-r->D";
LearnerGraphND grA = buildLearnerGraphND("A-a->E-s->E\nA-a->F-v->F\n"+common,name+"A",argConfig, converter);
grA.findVertex("F").setColour(JUConstants.RED);grA.findVertex("B").setColour(JUConstants.AMBER);grA.findVertex("B").setDepth(3);
CmpVertex newStateA = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID(testA), argConfig),
newStateB = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID(testB), argConfig);
newStateA.setHighlight(true);newStateB.setDepth(45);
grA.transitionMatrix.put(newStateA,grA.createNewRow());grA.transitionMatrix.put(newStateB,grA.createNewRow());
LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\n"+common,name+"B",argConfig, converter);
CmpVertex newStateC = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID(nameC), argConfig),
newStateD = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID(nameD), argConfig);
newStateC.setColour(JUConstants.BLUE);newStateD.setOrigState(VertexID.parseID("P609"));
grB.transitionMatrix.put(newStateC,grB.createNewRow());grB.transitionMatrix.put(newStateD,grB.createNewRow());
VertexID origID = VertexID.parseID("test orig");
grB.findVertex("B").setColour(JUConstants.GRAY);grB.findVertex("B").setOrigState(origID);grB.findVertex("B").setDepth(3);
LearnerGraphND result = checkDiffBetweenND(grA, grB,expectedKeyPairs,0,threadNumber,argConfig,converter);
Assert.assertEquals(JUConstants.GRAY,result.findVertex("B").getColour());
Assert.assertEquals(origID,result.findVertex("B").getOrigState());
Assert.assertNull(result.findVertex(testA));
Assert.assertNull(result.findVertex(testB));
Assert.assertNotNull(result.findVertex(nameC));
Assert.assertNotNull(result.findVertex(nameD));
Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(newStateC,result.findVertex(nameC)));
Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(newStateD,result.findVertex(nameD)));
// The last check: ensure that disconnected states are or are not key pairs.
// This chunk of code simply returns GD, the checking is performed by the caller of this method.
GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData> gd = new GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData>();
gd.init(grA, grB, threadNumber,argConfig);gd.identifyKeyPairs();