Package statechum.analysis.learning.linear.GD

Examples of statechum.analysis.learning.linear.GD.ChangesRecorder


 
    gd.init(grA, grB, threadNumber,configOneWay);
    gd.identifyKeyPairs();
    //printListOfPairs(gd, gd.currentWave);
    //printListOfPairs(gd, gd.frontWave);
    ChangesRecorder recorder = new ChangesRecorder(null);
    gd.makeSteps();gd.computeDifference(recorder);
    //printListOfPairs(gd, allKeyPairs);
    Assert.assertEquals(expectedMatchedPairs,gd.aTOb.size());
    LearnerGraph graph = buildLearnerGraph(graphA,name+"A",configOneWay,converter);
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));
    Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here


    Configuration configNesting = argConfig;if (configNesting == null) configNesting = config;
    LearnerGraph grA = buildLearnerGraph(graphA,name+"A",configNesting,converter);
    LearnerGraph grB = buildLearnerGraph(graphB,name+"B",configNesting,converter);
    grA.setIDNumbers();grB.setIDNumbers();
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    ChangesRecorder rec1 =   new ChangesRecorder(null);
    ChangesDisplay  rec2 = new ChangesDisplay(rec1);
    ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> rec3 = new ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>(grA,grB,rec2);
    ChangesRecorder rec4 =   new ChangesRecorder(rec3);
    ChangesDisplay  rec5 = new ChangesDisplay(rec4);
    ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>  rec6 = new ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>(grA,grB,rec5);
    ChangesRecorder rec7 =   new ChangesRecorder(rec6);
    ChangesDisplay  rec8 = new ChangesDisplay(rec7);
    ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>  rec9 = new ChangesCounter<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>(grA,grB,rec8);
    {// compute GD and check that changes recorded by rec9 are correct.
      LearnerGraph graph1 = buildLearnerGraph(graphA,name+"A",configNesting,converter);
      ChangesRecorder.applyGD(graph1, gd.computeGDToXML(grA, grB, threadNumber, TestGD.createDoc(), rec9,configNesting), converter);
      Assert.assertNull(WMethod.checkM(graph1, grB));Assert.assertEquals(grB.getStateNumber(),graph1.getStateNumber());
    }
    {// check that changes propagated to rec7 are correct.
      LearnerGraph graph2 = buildLearnerGraph(graphA,name+"A",configNesting,converter);
      ChangesRecorder.applyGD(graph2, rec7.writeGD(TestGD.createDoc()), converter);
      Assert.assertNull(WMethod.checkM(graph2, grB));Assert.assertEquals(grB.getStateNumber(),graph2.getStateNumber());
    }
    {// check that changes propagated to rec4 are correct.
      LearnerGraph graph3 = buildLearnerGraph(graphA,name+"A",configNesting,converter);
      ChangesRecorder.applyGD(graph3, rec4.writeGD(TestGD.createDoc()), converter);
View Full Code Here

  public final void testComputeGD5b_RA()
  {
    Configuration configGD5b = config.copy();configGD5b.setGdFailOnDuplicateNames(false);
    LearnerGraph grA = new LearnerGraph(configGD5b);grA.getInit().setAccept(false);
    LearnerGraph grB = convertToNumerical(new LearnerGraph(configGD5b));
    ChangesRecorder recorder = new ChangesRecorder(null);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    gd.computeGD(grA, grB, threadNumber, recorder,configGD5b);
    LearnerGraph graph = new LearnerGraph(configGD5b);graph.setInit(null);graph.transitionMatrix.clear();
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here

  public final void testComputeGD5b_AR()
  {
    Configuration configGD5b = config.copy();configGD5b.setGdFailOnDuplicateNames(false);
    LearnerGraph grA = new LearnerGraph(configGD5b);
    LearnerGraph grB = convertToNumerical(new LearnerGraph(configGD5b));grB.getInit().setAccept(false);
    ChangesRecorder recorder = new ChangesRecorder(null);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    gd.computeGD(grA, grB, threadNumber, recorder,configGD5b);
    LearnerGraph graph = new LearnerGraph(configGD5b);graph.setInit(null);graph.transitionMatrix.clear();
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here

  public final void testComputeGD5_RR()
  {
    Configuration configGD5 = config.copy();configGD5.setGdFailOnDuplicateNames(false);
    LearnerGraph grA = new LearnerGraph(configGD5);grA.getInit().setAccept(false);
    LearnerGraph grB = convertToNumerical(new LearnerGraph(configGD5));grB.getInit().setAccept(false);
    ChangesRecorder recorder = new ChangesRecorder(null);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    gd.computeGD(grA, grB, threadNumber, recorder,configGD5);
    LearnerGraph graph = new LearnerGraph(configGD5);graph.setInit(null);graph.transitionMatrix.clear();
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here

  public final void testComputeGD5d_RR()
  {
    Configuration configGD5d = config.copy();configGD5d.setGdFailOnDuplicateNames(false);
    LearnerGraph grA = new LearnerGraph(configGD5d);grA.getInit().setAccept(false);
    LearnerGraph grB = convertToNumerical(buildLearnerGraph(A6,"testComputeGD5b",configGD5d,converter));
    ChangesRecorder recorder = new ChangesRecorder(null);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    gd.computeGD(grA, grB, threadNumber, recorder,configGD5d);
    LearnerGraph graph = new LearnerGraph(configGD5d);graph.setInit(null);graph.transitionMatrix.clear();
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here

  public final void testComputeGD5e_RR()
  {
    Configuration configGD5e = config.copy();
    LearnerGraph grA = buildLearnerGraph(A6,"testComputeGD5b",configGD5e,converter);
    LearnerGraph grB = convertToNumerical(new LearnerGraph(configGD5e));grB.getInit().setAccept(false);
    ChangesRecorder recorder = new ChangesRecorder(null);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
    gd.computeGD(grA, grB, threadNumber, recorder,configGD5e);
    LearnerGraph graph = buildLearnerGraph(A6,"testComputeGD5b",configGD5e,converter);
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
    Assert.assertNull(WMethod.checkM(graph, grB));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
  }
View Full Code Here

    grA.setIDNumbers();grB.setIDNumbers();// if a vertex uses vertex names such as P1000, it will clash with numbered vertices generated by Linear. This is why we ensure absence of clashes by updating identifier numbers.
   
    grA.pathroutines.checkConsistency(grA);grB.pathroutines.checkConsistency(grB);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
   
    ChangesRecorder recorder = new ChangesRecorder(null);
    gd.computeGD(grA, grB, threadNumber,recorder,configDup);
    LearnerGraph graph = new LearnerGraph(grA,configDup);
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
   
    DifferentFSMException ex = WMethod.checkM_and_colours(grB, graph, VERTEX_COMPARISON_KIND.DEEP);
    Assert.assertNull(ex);
  }
View Full Code Here

    grA.findVertex(VertexID.parseID("P1002")).setColour(JUConstants.BLUE);
   
    grA.pathroutines.checkConsistency(grA);grB.pathroutines.checkConsistency(grB);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
   
    ChangesRecorder recorder = new ChangesRecorder(null);
    gd.computeGD(grA, grB, threadNumber,recorder,configDup);
    LearnerGraph graph = new LearnerGraph(grA,configDup);
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
   
    DifferentFSMException ex = WMethod.checkM_and_colours(grB, graph, VERTEX_COMPARISON_KIND.DEEP);
    Assert.assertNull(ex);
  }
View Full Code Here

    grA.findVertex(VertexID.parseID("P1003")).setColour(JUConstants.BLUE);
   
    grA.pathroutines.checkConsistency(grA);grB.pathroutines.checkConsistency(grB);
    GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData> gd = new GD<CmpVertex,CmpVertex,LearnerGraphCachedData,LearnerGraphCachedData>();
   
    ChangesRecorder recorder = new ChangesRecorder(null);
    gd.computeGD(grA, grB, threadNumber,recorder,configDup);
    LearnerGraph graph = new LearnerGraph(grA,configDup);
    ChangesRecorder.applyGD(graph, recorder.writeGD(TestGD.createDoc()), converter);
   
    DifferentFSMException ex = WMethod.checkM_and_colours(grB, graph, VERTEX_COMPARISON_KIND.DEEP);
    Assert.assertNull(ex);
  }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.linear.GD.ChangesRecorder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.