Package statechum.analysis.learning.rpnicore

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


    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",configND2, converter);
    grA.findVertex("F").setColour(JUConstants.RED);grA.findVertex("B").setColour(JUConstants.AMBER);grA.findVertex("B").setDepth(3);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\n"+common,name+"B",configND2, converter);
    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, 6,0,threadNumber,configND2,converter);
/*
    ChangesDisplay disp = new ChangesDisplay(null);
    gd.computeGD(grA, grB, threadNumber, disp,config);System.out.println(disp.toString());*/
 
View Full Code Here


    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",configND2, converter);
    grA.findVertex("F").setColour(JUConstants.RED);grA.findVertex("B").setColour(JUConstants.AMBER);grA.findVertex("B").setDepth(3);
    LearnerGraphND grB = buildLearnerGraphND("A-a->G-u->G\nA-a->H-t->H\n"+common,name+"B",configND2, converter);
    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, 6,0,threadNumber,configND2,converter);
/*
    ChangesDisplay disp = new ChangesDisplay(null);
    gd.computeGD(grA, grB, threadNumber, disp,config);System.out.println(disp.toString());*/
 
View Full Code Here

   
    LearnerGraphND result = checkDiffBetweenND(grA, grB, 6,0,threadNumber,configND2,converter);
/*
    ChangesDisplay disp = new ChangesDisplay(null);
    gd.computeGD(grA, grB, threadNumber, disp,config);System.out.println(disp.toString());*/
    Assert.assertEquals(JUConstants.GRAY,result.findVertex("B").getColour());
    Assert.assertEquals(origID,result.findVertex("B").getOrigState());
  }

  final static String nameC = "#", nameD = "@", testA="TA", testB="TB";

View Full Code Here

    LearnerGraphND result = checkDiffBetweenND(grA, grB, 6,0,threadNumber,configND2,converter);
/*
    ChangesDisplay disp = new ChangesDisplay(null);
    gd.computeGD(grA, grB, threadNumber, disp,config);System.out.println(disp.toString());*/
    Assert.assertEquals(JUConstants.GRAY,result.findVertex("B").getColour());
    Assert.assertEquals(origID,result.findVertex("B").getOrigState());
  }

  final static String nameC = "#", nameD = "@", testA="TA", testB="TB";

  /** Constructs a pair of graphs and runs a test. Used to check that key states which are not connected
View Full Code Here

  GraphMutator<List<CmpVertex>,LearnerGraphNDCachedData> mutator = null;
 
  void checkContainsTransition(String from, String to, String label)
  {
    LearnerGraphND mut = (LearnerGraphND)mutator.getMutated();Map<CmpVertex,Map<String,List<CmpVertex>>> matrix = mut.getTransitionMatrix();
    Assert.assertTrue(matrix.get(mut.findVertex(VertexID.parseID(from))).get(label).contains(mut.findVertex(VertexID.parseID(to))));
  }
 
  /** Attempts to add a transition once. */
  @Test
  public void testAddTransition1()
View Full Code Here

  GraphMutator<List<CmpVertex>,LearnerGraphNDCachedData> mutator = null;
 
  void checkContainsTransition(String from, String to, String label)
  {
    LearnerGraphND mut = (LearnerGraphND)mutator.getMutated();Map<CmpVertex,Map<String,List<CmpVertex>>> matrix = mut.getTransitionMatrix();
    Assert.assertTrue(matrix.get(mut.findVertex(VertexID.parseID(from))).get(label).contains(mut.findVertex(VertexID.parseID(to))));
  }
 
  /** Attempts to add a transition once. */
  @Test
  public void testAddTransition1()
View Full Code Here

              "'P1000',"+
              "[d,b,c,a]}");
    Synapse.StatechumProcess.parseStatemachine(grAerlang,grA,null,true);
    Assert.assertEquals(0, grA.getRedStateNumber());
    Synapse.StatechumProcess.setReds(new OtpErlangList(new OtpErlangObject[]{new OtpErlangAtom("P1002")}), grA);
    Assert.assertEquals(JUConstants.RED,grA.findVertex("P1002").getColour());
    Assert.assertEquals(1, grA.getRedStateNumber());
  }
 
  @Test
  public void testSetRed2()
View Full Code Here

              " {'P1002',d,'P1002'}],"+
              "'P1000',"+
              "[d,b,c,a]}");
    Synapse.StatechumProcess.parseStatemachine(grAerlang,grA,null,true);
    Assert.assertTrue(grA.getInit().isAccept());
    Assert.assertFalse(grA.findVertex("N1000").isAccept());
    grA.findVertex("N1000").setAccept(true);
   
    LearnerGraphND grB = new LearnerGraphND(config);
    Synapse.StatechumProcess.parseStatemachine(ErlangLabel.parseText("{statemachine,['P1000','P1001','N1000'],"+
              "[{'P1000',a,'P1001'},"+
View Full Code Here

              "'P1000',"+
              "[d,b,c,a]}");
    Synapse.StatechumProcess.parseStatemachine(grAerlang,grA,null,true);
    Assert.assertTrue(grA.getInit().isAccept());
    Assert.assertFalse(grA.findVertex("N1000").isAccept());
    grA.findVertex("N1000").setAccept(true);
   
    LearnerGraphND grB = new LearnerGraphND(config);
    Synapse.StatechumProcess.parseStatemachine(ErlangLabel.parseText("{statemachine,['P1000','P1001','N1000'],"+
              "[{'P1000',a,'P1001'},"+
              "{'P1000',c,'P1001'},"+
View Full Code Here

              "{'P1001',b,'P1000'},"+
              "{'P1001',d,'P1001'}],"+
              "'P1000',"+
              "[d,b,c,a]}"),grB,null,true);
    Assert.assertTrue(grB.getInit().isAccept());
    Assert.assertFalse(grB.findVertex("N1000").isAccept());
    grB.findVertex("N1000").setAccept(true);
   
    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[{'P1003','a','P1001'},"+
                                                 "{'P1003','c','P1001'},"+
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.