Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.VertexID


   * modifying the graph in the process. For graphs we'd rather not modify, this can be set to false, but then each call
   * will give the same identifier.
   */
  public synchronized VertexID nextID(JUConstants.VERTEXLABEL accepted, boolean store)
  {
    VertexID result = null;
    int positiveID = vertPositiveID, negativeID = vertNegativeID;
    if (config.getLearnerIdMode() == IDMode.POSITIVE_ONLY)
      result = new VertexID(VertKind.NEUTRAL,positiveID++);
    else
      result = (accepted != VERTEXLABEL.REJECT?new VertexID(VertKind.POSITIVE,positiveID++):
          new VertexID(VertKind.NEGATIVE,negativeID++));

    if (store)
    {
      vertPositiveID = positiveID;vertNegativeID = negativeID;
    }
View Full Code Here


  public synchronized VertexID getDefaultInitialPTAName()
  {
    if (config.getDefaultInitialPTAName().length() > 0)
      return VertexID.parseID(config.getDefaultInitialPTAName());
    return new VertexID(VertKind.POSITIVE,vertPositiveID++);
    // Since the text ID of the initial vertex is "Init" which does not contain numerical ID,
    // I cannot adequately load graphs containing such vertices. The best solution is to abolish it.
    //new VertexID(VertKind.INIT,vertPositiveID++);
  }
View Full Code Here

   
  /** Tests that it is not possible to create an invalid vertexid. */
  @Test(expected=IllegalArgumentException.class)
  public void testCannotCreateNoneVertexID1()
  {
    new VertexID(VertKind.NONE,3);
  }
View Full Code Here

 
  /** Tests that it is not possible to create an invalid vertexid. */
  @Test(expected=IllegalArgumentException.class)
  public void testCannotCreateNoneVertexID2()
  {
    new VertexID(null);
  }
View Full Code Here

 
  /** Tests equality for VertexIDs. */
  @Test
  public void testVertexIDEquals1()
  {
    equalityTestingHelper(new VertexID("A"), new VertexID("A"), new VertexID("B"), new VertexID("C"));
  }
View Full Code Here

  /** Tests equality for VertexIDs. */
  @Test
  public void testVertexIDEquals2()
  {
    equalityTestingHelper(new VertexID(VertKind.POSITIVE,5), new VertexID(VertKind.POSITIVE,5), new VertexID(VertKind.NEGATIVE,9), new VertexID(VertKind.INIT,9));
  }
View Full Code Here

 
  /** Tests equality for VertexIDs. */
  @Test
  public void testVertexIDEquals3()
  {
    equalityTestingHelper(new VertexID(VertKind.NEGATIVE,5), new VertexID(VertKind.NEGATIVE,5), new VertexID(VertKind.POSITIVE,5), new VertexID(VertKind.INIT,5));
  }
View Full Code Here

 
  /** Tests equality for VertexIDs with string and numerical IDs. */
  @Test
  public void testVertexIDEquals4()
  {
    equalityTestingHelper(new VertexID(VertKind.POSITIVE,5), new VertexID(idP5), new VertexID(idN5), new VertexID(VertKind.INIT,9));
  }
View Full Code Here

  /** Tests equality for VertexIDs with string and numerical IDs, checking that cached representation works. */
  @Test
  public void testVertexIDEquals_cached()
  {
    VertexID p=new VertexID(VertKind.POSITIVE,5), q=new VertexID(idP5),
    differentA=new VertexID(VertKind.POSITIVE,6), differentB=new VertexID(VertKind.INIT,9);
    equalityTestingHelper(p, p, differentA, differentB);// at this point, numeric ID will have a textual representation added

    equalityTestingHelper(p, q, differentA, differentB);
    equalityTestingHelper(p, new VertexID(idP5), differentA, differentB);
    equalityTestingHelper(new VertexID(idP5), q, differentA, differentB);
    equalityTestingHelper(new VertexID(idP5), q, new VertexID(idP6), new VertexID(VertKind.POSITIVE,6));
    equalityTestingHelper(new VertexID(idP5), q, new VertexID(idN5), new VertexID(VertKind.POSITIVE,6));
  }
View Full Code Here

  /** Tests VertexID toString methods. */
  @Test
  public void testVertexIDToString()
  {
    Assert.assertEquals("P5", new VertexID(idP5).toString());
    Assert.assertEquals("N5", new VertexID(idN5).toString());
    Assert.assertEquals("P5", new VertexID(VertKind.POSITIVE,5).toString());
    Assert.assertEquals("N5", new VertexID(VertKind.NEGATIVE,5).toString());

    Assert.assertEquals("JustAnything", new VertexID("JustAnything").toString());
    Assert.assertEquals("V5", new VertexID(VertKind.NEUTRAL,5).toString());
  }
View Full Code Here

TOP

Related Classes of statechum.DeterministicDirectedSparseGraph.VertexID

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.