Package statechum.analysis.learning.rpnicore

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


    grA.transitionMatrix.put(disconnectedA1,grA.createNewRow());grA.transitionMatrix.put(disconnectedA2,grA.createNewRow());
    grB.transitionMatrix.put(disconnectedB2,grB.createNewRow());grB.transitionMatrix.put(disconnectedB3,grB.createNewRow());
   
    String [] expectedDuplicates = (stateC.equals("C"))? new String[]{ stateC,"A" }:new String[]{"A"};
    LearnerGraphND outcome = runTest(grA,grB, "D", expectedDuplicates);
    Assert.assertNull(outcome.findVertex(disconnectedA1));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB2, outcome.findVertex(disconnectedB2)));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB3, outcome.findVertex(disconnectedB3)));
  }
 
  /** Graph B is slightly different now, hence duplicates are different too. */
 
View Full Code Here


    grB.transitionMatrix.put(disconnectedB2,grB.createNewRow());grB.transitionMatrix.put(disconnectedB3,grB.createNewRow());
   
    String [] expectedDuplicates = (stateC.equals("C"))? new String[]{ stateC,"A" }:new String[]{"A"};
    LearnerGraphND outcome = runTest(grA,grB, "D", expectedDuplicates);
    Assert.assertNull(outcome.findVertex(disconnectedA1));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB2, outcome.findVertex(disconnectedB2)));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB3, outcome.findVertex(disconnectedB3)));
  }
 
  /** Graph B is slightly different now, hence duplicates are different too. */
  @Test
 
View Full Code Here

   
    String [] expectedDuplicates = (stateC.equals("C"))? new String[]{ stateC,"A" }:new String[]{"A"};
    LearnerGraphND outcome = runTest(grA,grB, "D", expectedDuplicates);
    Assert.assertNull(outcome.findVertex(disconnectedA1));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB2, outcome.findVertex(disconnectedB2)));
    Assert.assertTrue(DeterministicDirectedSparseGraph.deepEquals(disconnectedB3, outcome.findVertex(disconnectedB3)));
  }
 
  /** Graph B is slightly different now, hence duplicates are different too. */
  @Test
  public final void testGD_nondetC()
View Full Code Here

        new String[]{"A","F"},
        new String[]{"C","G"},
        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
View Full Code Here

        new String[]{"A","F"},
        new String[]{"C","G"},
        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
View Full Code Here

  {
    LearnerGraphND ptaInverse = new LearnerGraphND(graph.config);
    AbstractPathRoutines.buildInverse(graph, new StatesToConsider() {
      @Override public boolean stateToConsider(@SuppressWarnings("unused") CmpVertex v) { return true; }}
      , ptaInverse);
    CmpVertex v=ptaInverse.findVertex(vert);
    for(int i=0;i<10;++i)
    {
      Map<Label,List<CmpVertex>> transitions = ptaInverse.transitionMatrix.get(v);
      if (transitions.size() > 1)
      {
View Full Code Here

  {
    LearnerGraphND ptaInverse = new LearnerGraphND(graph.config);
    AbstractPathRoutines.buildInverse(graph, new StatesToConsider() {
      @Override public boolean stateToConsider(@SuppressWarnings("unused") CmpVertex v) { return true; }}
      , ptaInverse);
    CmpVertex v=ptaInverse.findVertex(vert);
    for(int i=0;i<10;++i)
    {
      Map<Label,List<CmpVertex>> transitions = ptaInverse.transitionMatrix.get(v);
      if (transitions.size() > 1)
      {
View Full Code Here

  {
    LearnerGraphND ptaInverse = new LearnerGraphND(graph.config);
    AbstractPathRoutines.buildInverse(graph, new StatesToConsider() {
      @Override public boolean stateToConsider(@SuppressWarnings("unused") CmpVertex v) { return true; }}
      , ptaInverse);
    CmpVertex v=ptaInverse.findVertex(vert);
    for(int i=0;i<10;++i)
    {
      Map<Label,List<CmpVertex>> transitions = ptaInverse.transitionMatrix.get(v);
      if (transitions.size() > 1)
      {
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

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.