Package statechum.analysis.learning.rpnicore

Examples of statechum.analysis.learning.rpnicore.LearnerGraphND.addToCompatibility()


    Configuration cloneConfig = configND6.copy();cloneConfig.setLearnerCloneGraph(true);
    String common = "A-a->B-p->B\nA-a->C-q->C\nA-a->D-r->D\nU-a->U-b->R";
    LearnerGraphND grA = buildLearnerGraphND("A-a->E-s->E\nA-a->F-v->F\nC-p->S\n"+common,name+"A",configND6, converter);
    grA.findVertex("F").setColour(JUConstants.RED);grA.findVertex("B").setColour(JUConstants.AMBER);grA.findVertex("B").setDepth(3);
    grA.addToCompatibility(grA.findVertex("D"), grA.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\nC-q->T\n"+common,name+"B",configND6, converter);
    VertexID origID = VertexID.parseID("test orig");
    grB.findVertex("B").setColour(JUConstants.GRAY);grB.findVertex("B").setOrigState(origID);grB.findVertex("B").setDepth(3);
    grB.addToCompatibility(grB.findVertex("D"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
View Full Code Here


    String common = "A-a->B-p->B\nA-a->C-q->C\nA-a->D-r->D\nU-a->U-b->R";
    LearnerGraphND grA = buildLearnerGraphND("A-a->E-s->E\nA-a->F-v->F\nC-p->S\n"+common,name+"A",configND6, converter);
    grA.findVertex("F").setColour(JUConstants.RED);grA.findVertex("B").setColour(JUConstants.AMBER);grA.findVertex("B").setDepth(3);
    grA.addToCompatibility(grA.findVertex("D"), grA.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\nC-q->T\n"+common,name+"B",configND6, converter);
    VertexID origID = VertexID.parseID("test orig");
    grB.findVertex("B").setColour(JUConstants.GRAY);grB.findVertex("B").setOrigState(origID);grB.findVertex("B").setDepth(3);
    grB.addToCompatibility(grB.findVertex("D"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grB.addToCompatibility(grB.findVertex("U"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
View Full Code Here

    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\nC-q->T\n"+common,name+"B",configND6, converter);
    VertexID origID = VertexID.parseID("test orig");
    grB.findVertex("B").setColour(JUConstants.GRAY);grB.findVertex("B").setOrigState(origID);grB.findVertex("B").setDepth(3);
    grB.addToCompatibility(grB.findVertex("D"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grB.addToCompatibility(grB.findVertex("U"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grB.addToCompatibility(grB.findVertex("U"), grB.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
 
    LearnerGraphND result = checkDiffBetweenND(grA, grB, 8,0,threadNumber,configND6,converter);
    Assert.assertEquals(JUConstants.GRAY,result.findVertex("B").getColour());
View Full Code Here

    grA.addToCompatibility(grA.findVertex("U"), grA.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\nC-q->T\n"+common,name+"B",configND6, converter);
    VertexID origID = VertexID.parseID("test orig");
    grB.findVertex("B").setColour(JUConstants.GRAY);grB.findVertex("B").setOrigState(origID);grB.findVertex("B").setDepth(3);
    grB.addToCompatibility(grB.findVertex("D"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grB.addToCompatibility(grB.findVertex("U"), grB.findVertex("T"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    grB.addToCompatibility(grB.findVertex("U"), grB.findVertex("R"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
 
    LearnerGraphND result = checkDiffBetweenND(grA, grB, 8,0,threadNumber,configND6,converter);
    Assert.assertEquals(JUConstants.GRAY,result.findVertex("B").getColour());
    Assert.assertEquals(origID,result.findVertex("B").getOrigState());
View Full Code Here

      }

      @Override
      public void removeFromCompatibility(CmpVertex a, CmpVertex b, JUConstants.PAIRCOMPATIBILITY value) {
        super.removeFromCompatibility(a,b,value);
        removed.addToCompatibility(a, b, value);
      }

      @Override
      public void addRelabelling(VertID a, VertID b) {
        graphToPatch.addRelabelling(a, b);
View Full Code Here

  public final void testWriteAndLoad5()
  {
    LearnerGraphND graph = buildLearnerGraphND("A-a->B-a-#C\nA-d-#D\nA-c->A\nA-a->S-a->S","testWriteAndLoad5",Configuration.getDefaultConfiguration(), converter);
    graph.findVertex("B").setDepth(5);graph.findVertex("D").setColour(JUConstants.AMBER);
   
    graph.addToCompatibility(graph.findVertex("A"), graph.findVertex("B"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    ChangesRecorder patcher = new ChangesRecorder(null);
    patcher.addTransition(graph.findVertex("B"), AbstractLearnerGraph.generateNewLabel("c", cloneConfig), graph.findVertex("B"));
    patcher.removeTransition(graph.findVertex("A"), label_a, graph.findVertex("B"));
    patcher.removeFromCompatibility(graph.findVertex("B"), graph.findVertex("A"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    patcher.addToCompatibility(graph.findVertex("B"), graph.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
View Full Code Here

    graphPatcher.removeDanglingStates();
    LearnerGraphND result = new LearnerGraphND(Configuration.getDefaultConfiguration());
    graphPatcher.relabel(result);
   
    LearnerGraphND expected = buildLearnerGraphND("U-q->B-a-#R\nU-d-#D\nU-c->U\nB-c->B\nU-a->S-a->S","testWriteAndLoad1",Configuration.getDefaultConfiguration(), converter);
    expected.addToCompatibility(expected.findVertex("S"), expected.findVertex("B"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    expected.transitionMatrix.put(danglingVertex,expected.createNewRow());
    expected.findVertex("B").setDepth(5);expected.findVertex("D").setColour(JUConstants.AMBER);
 
    Assert.assertEquals(expected.getStateNumber(), graph.getStateNumber());
    Assert.assertNull(WMethod.checkM_and_colours(expected, result, VERTEX_COMPARISON_KIND.DEEP));
View Full Code Here

        new String[]{"C","F"}
    })
    {
      CmpVertex a=grA.findVertex(pair[0]),b=grA.findVertex(pair[1]);
      Assert.assertNotNull(a);Assert.assertNotNull(b);
      grA.addToCompatibility(a,b,JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    }
   
    // add incompatibles for B
    for(String []pair:new String[][]{
        new String[]{"B","D"},
View Full Code Here

  public final void testWriteAndLoad5()
  {
    LearnerGraphND graph = buildLearnerGraphND("A-a->B-a-#C\nA-d-#D\nA-c->A\nA-a->S-a->S","testWriteAndLoad5",Configuration.getDefaultConfiguration(), converter);
    graph.findVertex("B").setDepth(5);graph.findVertex("D").setColour(JUConstants.AMBER);
   
    graph.addToCompatibility(graph.findVertex("A"), graph.findVertex("B"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    ChangesRecorder patcher = new ChangesRecorder(null);
    patcher.addTransition(graph.findVertex("B"), AbstractLearnerGraph.generateNewLabel("c", cloneConfig), graph.findVertex("B"));
    patcher.removeTransition(graph.findVertex("A"), label_a, graph.findVertex("B"));
    patcher.removeFromCompatibility(graph.findVertex("B"), graph.findVertex("A"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    patcher.addToCompatibility(graph.findVertex("B"), graph.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
View Full Code Here

    graphPatcher.removeDanglingStates();
    LearnerGraphND result = new LearnerGraphND(Configuration.getDefaultConfiguration());
    graphPatcher.relabel(result);
   
    LearnerGraphND expected = buildLearnerGraphND("U-q->B-a-#R\nU-d-#D\nU-c->U\nB-c->B\nU-a->S-a->S","testWriteAndLoad1",Configuration.getDefaultConfiguration(), converter);
    expected.addToCompatibility(expected.findVertex("S"), expected.findVertex("B"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
    expected.transitionMatrix.put(danglingVertex,expected.createNewRow());
    expected.findVertex("B").setDepth(5);expected.findVertex("D").setColour(JUConstants.AMBER);
 
    Assert.assertEquals(expected.getStateNumber(), graph.getStateNumber());
    Assert.assertNull(WMethod.checkM_and_colours(expected, result, VERTEX_COMPARISON_KIND.DEEP));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.