Examples of VertexID


Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test
  public final void findMergablePair2()
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph("A-a->B\nA-b->B\nA-c->D\nA-b->D\nA-d->E", "findMergablePair2");
    Vertex
      b = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("B"), g),
      d = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("D"), g);
    Set<Vertex> expected = new HashSet<Vertex>();expected.add(d);expected.add(b);
    Set<Vertex> actualA = new HashSet<Vertex>();
    OrigStatePair value = RPNIBlueFringeLearnerOrig.findMergablePair(g);actualA.add(value.getQ());actualA.add(value.getR());
    Assert.assertTrue("expected: B, D in either order got: "+actualA,expected.equals(actualA));
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test
  public final void findMergablePair3a()
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph("S-p->A-a->S\nA-b->S\nA-c->D\nA-b->D\nA-d->E", "findMergablePair3a");
    Vertex
      s = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("S"), g),
      d = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("D"), g);
    OrigStatePair expected = new OrigStatePair(d,s),
    actualA = RPNIBlueFringeLearnerOrig.findMergablePair(g);
    Assert.assertTrue("expected: "+expected+" got: "+actualA,expected.equals(actualA));
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test
  public final void findMergablePair3b()
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph("S-p->A-a->B\nA-b->B\nA-c->S\nA-b->S\nA-d->E", "findMergablePair3b");
    Vertex
      b = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("B"), g),
      s = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("S"), g);
    OrigStatePair expected = new OrigStatePair(b,s),
    actualA = RPNIBlueFringeLearnerOrig.findMergablePair(g);
    Assert.assertTrue("expected: "+expected+" got: "+actualA,expected.equals(actualA));
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

      String stateBlue, String stateRed, String graphName, boolean checkWithEquals)
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph(machineToMerge, graphName),
      g2=(DirectedSparseGraph)g.copy();
    Vertex
      a = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID(stateRed), g),
      b = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID(stateBlue), g);
       
    Assert.assertNotNull("state "+stateRed+" was not found", a);
    Assert.assertNotNull("state "+stateBlue+" was not found", b);
   
    OrigStatePair pairOrig = new OrigStatePair(b,a);
    StatePair pairNew1 = new StatePair(DeterministicDirectedSparseGraph.findVertexNamed(new VertexID(stateBlue), g),DeterministicDirectedSparseGraph.findVertexNamed(new VertexID(stateRed), g));
    LearnerGraph l = new LearnerGraph(g, testConfig);
    StatePair pairNew2 = new StatePair(l.findVertex(new VertexID(stateBlue)),l.findVertex(new VertexID(stateRed)));
    LearnerGraph
      mergeResultA = new LearnerGraph(RPNIBlueFringeLearnerOrig.mergeAndDeterminize(g, pairOrig),testConfig),
      mergeResultB = new LearnerGraph(MergeStates.mergeAndDeterminize(g2, pairNew1,testConfig),testConfig),
      mergeResultC = new LearnerGraph(MergeStates.mergeAndDeterminize(l, pairNew2).paths.getGraph(),testConfig),
      mergeResultD = new LearnerGraph(MergeStates.mergeAndDeterminize_general(l, pairNew2).paths.getGraph(),testConfig),
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test
  public final void testMerge1a()
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph("S-p->A-a->S\nA-b->S\nA-c->D\nA-b->D\nA-d->E\nS-n->U", "testMerge1a");
    Vertex
      s = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("S"), g),
      d = DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("U"), g);
    OrigStatePair pair = new OrigStatePair(d,s);
    LearnerGraph
      mergeResultA = new LearnerGraph(RPNIBlueFringeLearnerOrig.mergeAndDeterminize(g, pair),testConfig),
      expectedResult = new LearnerGraph(TestFSMAlgo.buildGraph("S-p->A-a->S\nA-b->S\nA-c->S\nA-d->E\nS-n->S", "expected"),testConfig);
    Assert.assertTrue(expectedResult.equals(mergeResultA));
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test(expected = IllegalArgumentException.class)
  public final void testMerge_fail1a()
  {
    DirectedSparseGraph g=TestFSMAlgo.buildGraph(largeGraph1_invalid5,"testMerge_fail1");
    CmpVertex
      a = DeterministicDirectedSparseGraph.findVertexNamed(new VertexID("A"), g),
      b = DeterministicDirectedSparseGraph.findVertexNamed(new VertexID("B"), g);
    StatePair pair = new StatePair(b,a);// A is red
    MergeStates.mergeAndDeterminize(g, pair,testConfig);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test(expected = IllegalArgumentException.class)
  public final void testMerge_fail2()
  {
    LearnerGraph l=new LearnerGraph(TestFSMAlgo.buildGraph(largeGraph1_invalid5,"testMerge_fail1"),testConfig);
    CmpVertex
      a = l.findVertex(new VertexID("A")),
      b = l.findVertex(new VertexID("B"));
    StatePair pair = new StatePair(b,a);// A is red
    MergeStates.mergeAndDeterminize(l, pair);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  @Test(expected = IllegalArgumentException.class)
  public final void testMerge_fail3()
  {
    LearnerGraph l=new LearnerGraph(TestFSMAlgo.buildGraph(largeGraph1_invalid5,"testMerge_fail1"),testConfig);
    CmpVertex
      a = l.findVertex(new VertexID("A")),
      b = l.findVertex(new VertexID("B"));
    StatePair pair = new StatePair(b,a);// A is red
    MergeStates.mergeAndDeterminize_general(l, pair);
  }
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

  private final void testChooseStatePairsInternal(DirectedSparseGraph g,LearnerGraph l, String [] initialReds, String [][] expectedReds,
      List<PairScore> expectedPairs,InterfaceChooserToTest chooser)
  {
    for(String red:initialReds)
    {
      CmpVertex v = l.findVertex(new VertexID(red));v.setColour(JUConstants.RED);
    }
    Stack<? extends StatePair> pairs = chooser.choosePairs();

    Map<Integer,Set<PairScore>> distribution = new HashMap<Integer,Set<PairScore>>();// maps scores to sets of states which should correspond to them. The aim is to verify the contents of the stack regardless of the order in which elements with the same score are arranged.
View Full Code Here

Examples of statechum.DeterministicDirectedSparseGraph.VertexID

      int k1,int k2,int k3,
      String graphName)
  {
    DirectedSparseGraph g = TestFSMAlgo.buildGraph(fsm, graphName);
    OrigStatePair pairOrig = new OrigStatePair(
        DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("B"), g),
        DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL, new VertexID("A"), g));
   
    LearnerGraph s = new LearnerGraph(g, testConfig);
    StatePair pairNew = new StatePair(
        s.findVertex(new VertexID("B")),
        s.findVertex(new VertexID("A")));
    doneEdges = new HashSet<DirectedSparseEdge>();
    s.config.setLearnerScoreMode(Configuration.ScoreMode.CONVENTIONAL);s.setMaxScore(maxScoreConstant-1);
    int origScore = computeScore(g, pairOrig),
      newScoreA = s.pairscores.computeStateScore(pairNew),
      newScoreB = s.pairscores.computePairCompatibilityScore(pairNew);
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.