Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.DeterministicVertex


 
  /** Handling of depth using representatives where multiple equivalence classes are merged. */
  @Test
  public final void testEqClassRepresentatives6() throws IncompatibleStatesException
  {
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C=new DeterministicVertex("C"), D=new DeterministicVertex("D"),
      E = new DeterministicVertex("E");
    B.setDepth(5);C.setDepth(45);D.setDepth(4);E.setDepth(4);
    AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>
      eqClassA = buildClass(new AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>(0,testGraphString),
          new CmpVertex[]{A,B}),
      eqClassB = buildClass(new AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>(0,testGraphString),
          new CmpVertex[]{C,D}),eqClassC = buildClass(new AMEquivalenceClass<CmpVertex,LearnerGraphCachedData>(0,testGraphString),new CmpVertex[]{E});
View Full Code Here


 
  /** Testing whether checking for incompatible vertices works correctly. */
  @Test
  public final void testIncompatChecking1()
  {
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C=new DeterministicVertex("C");
    C.setAccept(false);
    PairCompatibility<CmpVertex> incompatibles = new PairCompatibility<CmpVertex>(HashMapWithSearch.DEFAULT_INITIAL_CAPACITY);
    Assert.assertTrue(AbstractLearnerGraph.checkCompatible(A, B, incompatibles));
    Assert.assertTrue(AbstractLearnerGraph.checkCompatible(B, A, incompatibles));
    Assert.assertTrue(AbstractLearnerGraph.checkCompatible(A, A, incompatibles));
    Assert.assertTrue(AbstractLearnerGraph.checkCompatible(B, B, incompatibles));
View Full Code Here

  @Test
  public final void testStatePairEquality()
  {
    final Object samePairs[] = new StatePair[]{
        new StatePair(new StringVertex("a"), new StringVertex("b")),
        new StatePair(new DeterministicVertex("a"), new StringVertex("b")),
        new StatePair(new StringVertex("a"), new DeterministicVertex("b")),
        new StatePair(new DeterministicVertex("a"), new DeterministicVertex("b"))       
    },
    differentPairs[] = new Object[] {
        new StatePair(new StringVertex("a"), new StringVertex("c")),
        new StatePair(new StringVertex("d"), new StringVertex("b")),
        new StatePair(new StringVertex("d"), new StringVertex("e")),
View Full Code Here

  /** Tests that nulls are valid elements of state pairs. */
  public final void testStatePairEqualityWithNulls1()
  {
    final Object samePairs[] = new StatePair[]{
        new StatePair(null, new StringVertex("b")),
        new StatePair(null, new DeterministicVertex("b"))     
    },
    differentPairs[] = new Object[] {
        new StatePair(new StringVertex("b"), new StringVertex("b")),
        new StatePair(new DeterministicVertex("b"), new StringVertex("b")),
        new StatePair(null, null),
        constructOrigPair("a", "b")
    };
    for(int sameFirst=0;sameFirst<samePairs.length;++sameFirst)
      for(int sameSecond=0;sameSecond<samePairs.length;++sameSecond)
View Full Code Here

  /** Tests that nulls are valid elements of state pairs. */
  public final void testStatePairEqualityWithNulls2()
  {
    final Object samePairs[] = new StatePair[]{
        new StatePair(new StringVertex("b"), null),
        new StatePair(new DeterministicVertex("b"),null)
    },
    differentPairs[] = new Object[] {
        new StatePair(new StringVertex("b"), new StringVertex("b")),
        new StatePair(new DeterministicVertex("b"), new StringVertex("b")),
        new StatePair(null, null),
        constructOrigPair("a", "b")
    };
    for(int sameFirst=0;sameFirst<samePairs.length;++sameFirst)
      for(int sameSecond=0;sameSecond<samePairs.length;++sameSecond)
View Full Code Here

    final Object samePairs[] = new StatePair[]{
        new StatePair(null, null)
    },
    differentPairs[] = new Object[] {
        new StatePair(null, new StringVertex("b")),
        new StatePair(new DeterministicVertex("b"), null),
        constructOrigPair("a", "b")
    };
    for(int sameFirst=0;sameFirst<samePairs.length;++sameFirst)
      for(int sameSecond=0;sameSecond<samePairs.length;++sameSecond)
        for(int different=0;different<differentPairs.length;++different)
View Full Code Here

  }
 
  private final static void checkLess(String a,String b,String c,String d)
  {
    checkLessHelper(new StatePair(new StringVertex(a), new StringVertex(b)), new StatePair(new StringVertex(c), new StringVertex(d)));
    checkLessHelper(new StatePair(new DeterministicVertex(a), new StringVertex(b)), new StatePair(new DeterministicVertex(c), new StringVertex(d)));
    checkLessHelper(new StatePair(new StringVertex(a), new DeterministicVertex(b)), new StatePair(new StringVertex(c), new DeterministicVertex(d)));
  }
View Full Code Here

  /** Checking that attributes which are cleared are not added to a Jung vertex. */
  @Test
  public final void testVertexConstruction()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DeterministicVertex vertex = new DeterministicVertex("testVertex");
    vertex.setAccept(false);vertex.setHighlight(true);vertex.setColour(JUConstants.AMBER);vertex.setOrigState(VertexID.parseID("id"));vertex.setDepth(34);
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.LABEL));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.ACCEPTED));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.HIGHLIGHT));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.COLOUR));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.ORIGSTATE));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.DEPTH));
   
    vertex.setAccept(true);vertex.setHighlight(false);vertex.setColour(null);vertex.setOrigState(null);vertex.setDepth(JUConstants.intUNKNOWN);
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.LABEL));
    Assert.assertTrue(vertex.containsUserDatumKey(JUConstants.ACCEPTED));
    Assert.assertFalse(vertex.containsUserDatumKey(JUConstants.HIGHLIGHT));
    Assert.assertFalse(vertex.containsUserDatumKey(JUConstants.COLOUR));
    Assert.assertFalse(vertex.containsUserDatumKey(JUConstants.ORIGSTATE));
    Assert.assertFalse(vertex.containsUserDatumKey(JUConstants.DEPTH));
  }
View Full Code Here

  }

  @Test
  public void testAddEdge1()
  {
    DeterministicVertex vA = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("C"),gen.machine),
    vB = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("B"),gen.machine);

    LearnerGraph outcome = new LearnerGraph(gen.machine,Configuration.getDefaultConfiguration());
    Assert.assertEquals(0,outcome.getTransitionMatrix().get(outcome.findVertex(VertexID.parseID("C"))).size());
    Assert.assertTrue(gen.addEdgeInternal(vA, vB));// this adds a numeric label
View Full Code Here

 
  /** Parallel edge. */
  @Test
  public void testAddEdge2()
  {
    DeterministicVertex vA = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("A"),gen.machine),
    vB = (DeterministicVertex) DeterministicDirectedSparseGraph.findVertex(JUConstants.LABEL,VertexID.parseID("B"),gen.machine);

    LearnerGraph outcome = new LearnerGraph(gen.machine,Configuration.getDefaultConfiguration());
    Assert.assertEquals(2,outcome.getTransitionMatrix().get(outcome.findVertex(VertexID.parseID("A"))).size());
    Assert.assertTrue(gen.addEdgeInternal(vA, vB));// this adds a numeric label
View Full Code Here

TOP

Related Classes of statechum.DeterministicDirectedSparseGraph.DeterministicVertex

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.