Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.VertexID


      updateIDWith(vert);
  }
 
  public void updateIDWith(CmpVertex vert)
  {
    VertexID id = vert.getID();
    if ((id.getKind() == VertKind.NEUTRAL || id.getKind() == VertKind.POSITIVE)
      && id.getIngegerID() >= vertPositiveID)
      vertPositiveID = id.getIngegerID()+1;
    if ((id.getKind() == VertKind.NEGATIVE)
        && id.getIngegerID() >= vertNegativeID)
      vertNegativeID = id.getIngegerID()+1;
  }
View Full Code Here


   * 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 new VertexID(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

    CmpVertex result = null;
    Iterator<Entry<CmpVertex,Map<String,TARGET_TYPE>>> entryIt = transitionMatrix.entrySet().iterator();
    while(entryIt.hasNext() && result == null)
    {
      CmpVertex currentVert = entryIt.next().getKey();
      VertexID vertName = currentVert.getID();
      if (vertName.equals(name))
        result = currentVert;
    }
    return result;
  }
View Full Code Here

  /** Non-existing vertices in a tentative automaton. */
  @Test
  public final void testPerformAugment_fail0()
  {
    final LearnerGraph graph = buildLearnerGraph("A-a->B-b->C", "testPerformAugment_fail0a",mainConfiguration,converter);
    graph.transitionMatrix.put(AbstractLearnerGraph.generateNewCmpVertex(new VertexID(VertKind.NONEXISTING,90),mainConfiguration),graph.createNewRow());
    Helper.checkForCorrectException(new whatToRun() { public @Override void run() throws IncompatibleStatesException {
      LearnerGraph[] ifthenCollection = new LearnerGraph[]{buildLearnerGraph("A-a->B-a->B /  T-b->N / B=THEN=T", "testPerformAugment_fail0b", mainConfiguration,converter)};
      Transform.augmentFromIfThenAutomaton(graph, null, ifthenCollection, 2);
    }},IllegalArgumentException.class,"non-existing vertices");
  }
View Full Code Here

 
  @Test
  public void testGraphConstructionFail2()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("B"), UserData.SHARED);
    checkWithVertex(v, "multiple states with the same name", "testGraphConstructionFail2");
  }
View Full Code Here

 
  @Test
  public void testGraphConstructionFail3()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("CONFL"), UserData.SHARED);
    checkWithVertex(v, "multiple states with the same name", "testGraphConstructionFail3");
  }
View Full Code Here

 
  @Test
  public void testGraphConstructionFail4a()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    checkWithVertex(v, "both labelled as initial states", "testGraphConstructionFail4a");
  }
View Full Code Here

 
  @Test
  public void testGraphConstructionFail4b()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, new VertexID("aa"), UserData.SHARED);
    checkWithVertex(v, "invalid init property", "testGraphConstructionFail4b");
  }
View Full Code Here

 
  @Test
  public void testGraphConstructionFail5a()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, "aa", UserData.SHARED);
    checkWithVertex(v, "invalid init property", "testGraphConstructionFail5a");
  }
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.