Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.DeterministicVertex


  }

  @Test
  public void checkDComparison1()
  {
    checkLessHelper(DvertA, new DeterministicVertex("b"));
  }
View Full Code Here


 
  @Test
  public void checkComparison_differentTypes()
  {
    checkLessHelper(DvertA, new StringVertex("b"));
    checkLessHelper(SvertA, new DeterministicVertex("b"));
  }
View Full Code Here

   */
 
  @Test
  public void testDeterministicVertexComparison1_old()
  {
    DeterministicVertex p = new DeterministicVertex("P"), q= new DeterministicVertex("Q");
    assertFalse(p.equals(q));
    assertTrue(p.compareTo(q)<0);
    assertTrue(q.compareTo(p)>0);
    assertFalse(p.hashCode() == q.hashCode());
    assertEquals(0,p.compareTo(p));
    assertEquals(0,q.compareTo(q));
  }
View Full Code Here

  {
      if (conf.isLearnerUseStrings())
          return  new StringVertex(name);
      synchronized(syncObj)
      {
        return new DeterministicVertex(name);     
      }   
  }
View Full Code Here

  }
   
  @Test
  public void testDeterministicVertexComparison2_old()
  {
    DeterministicVertex p = new DeterministicVertex("A"), q= new DeterministicVertex("B");
    assertFalse(p.equals(q));
    assertTrue(p.compareTo(q)<0);
    assertTrue(q.compareTo(p)>0);
    assertFalse(p.hashCode() == q.hashCode());
    assertEquals(0,p.compareTo(p));
    assertEquals(0,q.compareTo(q));
  }
View Full Code Here

  }

  @Test
  public void testDeterministicVertexComparison3_old()
  {
    DeterministicVertex p = new DeterministicVertex("P"), q= new DeterministicVertex("P");
    assertTrue(p.equals(q));
    assertTrue(p.compareTo(q)==0);
  }
View Full Code Here

  @Test
  public 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

  }
 
  private 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

    g.setUserDatum(JUConstants.TITLE, name,UserData.SHARED);

    new TestFSMParser.fsmParser(fsm).parse(new TestFSMParser.TransitionReceiver()
    {
      public void put(String from, String to, String label, boolean accept) {
        DeterministicVertex fromVertex = existingVertices.get(from), toVertex = existingVertices.get(to);
       
        if (fromVertex == null)
        {
          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex(from);
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
        else
          if (!Boolean.valueOf(fromVertex.getUserDatum(JUConstants.ACCEPTED).toString()))
            throw new IllegalArgumentException("conflicting acceptance assignment on vertex "+from);

        if (from.equals(to))
        {
          if (!accept) throw new IllegalArgumentException("conflicting acceptance assignment on vertex "+to);
View Full Code Here

  public static final String PTA1 = "\nA-p->I-q->B"+"\nB-a->B1-a-#B2\nB1-b->B3-b->B4\n";
 
  @Test(expected = IllegalArgumentException.class)
  public final void testLearnerFailsWhenRedNotFound()
  {
    ComputeQuestions.computeQS_orig(new StatePair(null,new DeterministicVertex("non-existing")), new LearnerGraph(testConfig), new LearnerGraph(testConfig));
  }
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.