Package statechum.analysis.learning.rpnicore.PairScoreComputation

Examples of statechum.analysis.learning.rpnicore.PairScoreComputation.StringVertexPair


  public void addFrom(CmpVertex vert,Collection<Entry<String,CmpVertex>> from) throws IncompatibleStatesException
  {
    addState(vert);
    if (from != null)
      for(Entry<String,CmpVertex> entry:from)
        outgoingTransitions.add(new StringVertexPair(entry.getKey(),entry.getValue()));
  }
View Full Code Here


  {
    addState(vert);

    newOutgoingTransitions = new TreeSet<StringVertexPair>();
    for(Entry<String,CmpVertex> entry:from)
      newOutgoingTransitions.add(new StringVertexPair(entry.getKey(),entry.getValue()));
  }
View Full Code Here

  @Test
  public final void testEqualityAndHashOfStringVertexPair()
  {
    StringVertex A=new StringVertex("A"), B=new StringVertex("B");
    StringVertexPair sameA=new StringVertexPair("a",A), sameB=new StringVertexPair("a",A),
      differentPairA=new StringVertexPair("a",B),differentPairB=new StringVertexPair("c",A);
    equalityTestingHelper(sameA, sameB, differentPairA, differentPairB);
    Assert.assertEquals(0,sameA.compareTo(sameB));
    Assert.assertEquals(0,sameB.compareTo(sameA));
  }
View Full Code Here

 
  @Test
  public final void testComparisonOfStringVertexPairs()
  {
    StringVertex A=new StringVertex("A");
    checkLessHelper(new StringVertexPair("a",A), new StringVertexPair("b",A));
  }
View Full Code Here

    eqClass.addFrom(A, gr.transitionMatrix.get(A).entrySet());
    eqClass.addFrom(A, gr.transitionMatrix.get(A).entrySet());
    eqClass.addFrom(B, gr.transitionMatrix.get(B).entrySet());
    Assert.assertSame(A,eqClass.getRepresentative());
    Set<StringVertexPair> expectedTargets = new TreeSet<StringVertexPair>();
    expectedTargets.add(new StringVertexPair("a", B));
    expectedTargets.add(new StringVertexPair("b", C));
    expectedTargets.add(new StringVertexPair("a", D));
    expectedTargets.add(new StringVertexPair("d", A));
    Assert.assertEquals(expectedTargets, eqClass.getOutgoing());
  }
View Full Code Here

    eqClass.addFrom(A, gr.transitionMatrix.get(A).entrySet());
    eqClass.mergeWith(B, gr.transitionMatrix.get(B).entrySet());
   
    Assert.assertSame(A,eqClass.getRepresentative());Assert.assertEquals(10, eqClass.getNumber());
    Set<StringVertexPair> expectedTargetsCurrent = new TreeSet<StringVertexPair>();
    expectedTargetsCurrent.add(new StringVertexPair("a", B));expectedTargetsCurrent.add(new StringVertexPair("d", A));
    Set<StringVertexPair> expectedTargetsNew = new TreeSet<StringVertexPair>();
    expectedTargetsNew.add(new StringVertexPair("b", C));expectedTargetsNew.add(new StringVertexPair("a", D));
    Set<StringVertexPair> expectedTargetsTotal = new TreeSet<StringVertexPair>();
    expectedTargetsTotal.add(new StringVertexPair("a", B));
    expectedTargetsTotal.add(new StringVertexPair("b", C));
    expectedTargetsTotal.add(new StringVertexPair("a", D));
    expectedTargetsTotal.add(new StringVertexPair("d", A));
    Assert.assertEquals(expectedTargetsCurrent, eqClass.getOutgoing());
    Assert.assertEquals(expectedTargetsNew, eqClass.getNewOutgoing());
    eqClass.populate();
    Assert.assertEquals(expectedTargetsTotal, eqClass.getOutgoing());
  }
View Full Code Here

    Assert.assertEquals(4, eqClassA.getNumber());Assert.assertEquals(1, eqClassB.getNumber());
   
    eqClassA.mergeWith(eqClassB);
   
    Set<StringVertexPair> expectedTargetsCurrent = new TreeSet<StringVertexPair>();
    expectedTargetsCurrent.add(new StringVertexPair("a", B));expectedTargetsCurrent.add(new StringVertexPair("d", A));
    Set<StringVertexPair> expectedTargetsNew = new TreeSet<StringVertexPair>();
    expectedTargetsNew.add(new StringVertexPair("b", C));expectedTargetsNew.add(new StringVertexPair("a", D));
    Set<StringVertexPair> expectedTargetsTotal = new TreeSet<StringVertexPair>();
    expectedTargetsTotal.add(new StringVertexPair("a", B));
    expectedTargetsTotal.add(new StringVertexPair("b", C));
    expectedTargetsTotal.add(new StringVertexPair("a", D));
    expectedTargetsTotal.add(new StringVertexPair("d", A));
    Assert.assertEquals(expectedTargetsCurrent, eqClassA.getOutgoing());
    Assert.assertEquals(expectedTargetsNew, eqClassA.getNewOutgoing());
    eqClassA.populate();
    Assert.assertEquals(expectedTargetsTotal, eqClassA.getOutgoing());
  }
View Full Code Here

  @Test
  public final void testEqualityAndHashOfStringVertexPair()
  {
    StringVertex A=new StringVertex("A"), B=new StringVertex("B");
    StringVertexPair sameA=new StringVertexPair("a",A), sameB=new StringVertexPair("a",A),
      differentPairA=new StringVertexPair("a",B),differentPairB=new StringVertexPair("c",A);
    equalityTestingHelper(sameA, sameB, differentPairA, differentPairB);
    Assert.assertEquals(0,sameA.compareTo(sameB));
    Assert.assertEquals(0,sameB.compareTo(sameA));
  }
View Full Code Here

 
  @Test
  public final void testComparisonOfStringVertexPairs()
  {
    StringVertex A=new StringVertex("A");
    checkLessHelper(new StringVertexPair("a",A), new StringVertexPair("b",A));
  }
View Full Code Here

    eqClass.addFrom(A, gr.transitionMatrix.get(A).entrySet());
    eqClass.addFrom(A, gr.transitionMatrix.get(A).entrySet());
    eqClass.addFrom(B, gr.transitionMatrix.get(B).entrySet());
    Assert.assertSame(A,eqClass.getRepresentative());
    Set<StringVertexPair> expectedTargets = new TreeSet<StringVertexPair>();
    expectedTargets.add(new StringVertexPair("a", B));
    expectedTargets.add(new StringVertexPair("b", C));
    expectedTargets.add(new StringVertexPair("a", D));
    expectedTargets.add(new StringVertexPair("d", A));
    Assert.assertEquals(expectedTargets, eqClass.getOutgoing());
  }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.PairScoreComputation.StringVertexPair

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.