Package statechum.DeterministicDirectedSparseGraph

Examples of statechum.DeterministicDirectedSparseGraph.CmpVertex.addUserDatum()


       
        if (fromVertex == null)
        {
          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.PROPERTY, JUConstants.INIT, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.LABEL, from, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
View Full Code Here


        if (fromVertex == null)
        {
          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.PROPERTY, JUConstants.INIT, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.LABEL, from, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
        else
View Full Code Here

        {
          fromVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
          if (existingVertices.isEmpty())
            fromVertex.addUserDatum(JUConstants.PROPERTY, JUConstants.INIT, UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.ACCEPTED, "true", UserData.SHARED);
          fromVertex.addUserDatum(JUConstants.LABEL, from, UserData.SHARED);
          existingVertices.put(from, fromVertex);
          g.addVertex(fromVertex);
        }
        else
          if (!Boolean.valueOf(fromVertex.getUserDatum(JUConstants.ACCEPTED).toString()))
View Full Code Here

  {
    String vertName = (String)origVertex.getUserDatum(JUConstants.LABEL);
    CmpVertex newVertex = newVertices.get(vertName);
    if (newVertex == null) {
      newVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
      newVertex.addUserDatum(JUConstants.LABEL, vertName, UserData.SHARED);
      newVertex.addUserDatum(JUConstants.ACCEPTED, TestRpniLearner.isAccept(origVertex)? "true":"false", UserData.SHARED);
      Object property = origVertex.getUserDatum(JUConstants.PROPERTY);
      if (property != null) newVertex.addUserDatum(JUConstants.PROPERTY, property, UserData.SHARED);
      newVertices.put(vertName,newVertex);g.addVertex(newVertex);
    }
View Full Code Here

    String vertName = (String)origVertex.getUserDatum(JUConstants.LABEL);
    CmpVertex newVertex = newVertices.get(vertName);
    if (newVertex == null) {
      newVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
      newVertex.addUserDatum(JUConstants.LABEL, vertName, UserData.SHARED);
      newVertex.addUserDatum(JUConstants.ACCEPTED, TestRpniLearner.isAccept(origVertex)? "true":"false", UserData.SHARED);
      Object property = origVertex.getUserDatum(JUConstants.PROPERTY);
      if (property != null) newVertex.addUserDatum(JUConstants.PROPERTY, property, UserData.SHARED);
      newVertices.put(vertName,newVertex);g.addVertex(newVertex);
    }
    return newVertex;
View Full Code Here

    if (newVertex == null) {
      newVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
      newVertex.addUserDatum(JUConstants.LABEL, vertName, UserData.SHARED);
      newVertex.addUserDatum(JUConstants.ACCEPTED, TestRpniLearner.isAccept(origVertex)? "true":"false", UserData.SHARED);
      Object property = origVertex.getUserDatum(JUConstants.PROPERTY);
      if (property != null) newVertex.addUserDatum(JUConstants.PROPERTY, property, UserData.SHARED);
      newVertices.put(vertName,newVertex);g.addVertex(newVertex);
    }
    return newVertex;
  }
 
View Full Code Here

   */
  private CmpVertex addVertex(CmpVertex prevState, boolean accepted, String input)
  {
    assert Thread.holdsLock(syncObj);
    CmpVertex newVertex = new DeterministicDirectedSparseGraph.DeterministicVertex();
    newVertex.addUserDatum(JUConstants.LABEL,
        nextID(accepted),
        UserData.SHARED);
    newVertex.setUserDatum(JUConstants.ACCEPTED, ""+accepted, UserData.SHARED);
    transitionMatrix.put(newVertex, new TreeMap<String,CmpVertex>());
    transitionMatrix.get(prevState).put(input,newVertex);
View Full Code Here

    int position = 0;
    while(inputIt.hasNext() && currentState != null)
    {
      if (!TestRpniLearner.isAccept(currentState))
      {// not the last state and the already-reached state is not accept, while all prefixes of reject sequences should be accept ones.
        currentState.addUserDatum("pair", "whatever", UserData.SHARED);
        throw new IllegalArgumentException("incompatible "+(accepted?"accept":"reject")+" labelling: "+sequence.subList(0, position));
      }
      prevState = currentState;lastInput = inputIt.next();++position;
     
      currentState = transitionMatrix.get(prevState).get(lastInput);
View Full Code Here

    }
    else
    {// we reached the end of the PTA
      if (TestRpniLearner.isAccept(currentState) != accepted)
      {
        currentState.addUserDatum("pair", "whatever", UserData.SHARED);
        throw new IllegalArgumentException("incompatible "+(accepted?"accept":"reject")+" labelling: "+sequence.subList(0, position));
      }
     
    }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.