Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseVertex


        currentVertex.setUserDatum("strength", new Integer(++currentVertexStrength),
            new UserDataContainer.CopyAction.Shared());
        return currentVertex;
      }
    }
    return new DirectedSparseVertex();
  }
View Full Code Here


  }

  private Vertex createNode(String nodeKey) {
    nodeCount++;
   
    Vertex node = new DirectedSparseVertex();
    node.addUserDatum("strength", new Integer(1), new UserDataContainer.CopyAction.Shared());
    node.addUserDatum("label", nodeKey, new UserDataContainer.CopyAction.Shared());
   
    outputGraph.addVertex(node);
    nodeLabels.add(nodeKey);
   
    return node;
View Full Code Here

                 }
                 svcextinfolist.add((ServiceExtInfo)n);
            } else if (n instanceof Host) {
                try {
                    if (_graphManager.getType() == GraphTypes.Directed)
                        v = _graphManager.addVertex(new DirectedSparseVertex(), ((Host)n).getName());
                    else if (_graphManager.getType() == GraphTypes.UnDirected) {
                        v = _graphManager.addVertex(new UndirectedSparseVertex(), ((Host)n).getName());
                    }
                    v.setUserDatum("host", (Host)n, UserData.CLONE);
                } catch (UniqueLabelException ule) {}
View Full Code Here

    queue.add(0,init);
    int i=0;
    int j= queue.size();
    Set<Vertex> done = new HashSet<Vertex>();
    while(i<j){
      DirectedSparseVertex v = (DirectedSparseVertex)queue.get(i);
      done.add(v);
      Iterator succIt = v.getSuccessors().iterator();
      while(succIt.hasNext()){
        Vertex succ = (Vertex)succIt.next();
        if(!done.contains(succ))
          queue.add(succ);
      }
View Full Code Here

  }

  /** Creates a graph with a single accept-vertex. */
  public static DirectedSparseGraph initialise(){
    DirectedSparseGraph pta = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    pta.setUserDatum(JUConstants.TITLE, "Hypothesis machine", UserData.SHARED);
    pta.addVertex(init);
    DeterministicDirectedSparseGraph.numberVertices(pta);
    return pta;
  }
View Full Code Here

   * @param reject the name of the reject state, to be added to the graph.
   * @return true if any transitions have been added
   */  
  public static boolean completeGraph(DirectedSparseGraph g, String reject)
  {
    DirectedSparseVertex rejectVertex = new DirectedSparseVertex();
    boolean transitionsToBeAdded = false;// whether and new transitions have to be added.
    rejectVertex.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    rejectVertex.addUserDatum(JUConstants.LABEL, reject, UserData.SHARED);
   
    // first pass - computing an alphabet
    Set<String> alphabet = computeAlphabet(g);
   
    // second pass - checking if any transitions need to be added.
View Full Code Here

    queue.add(0,init);
    int i=0;
    int j= queue.size();
    Set<Vertex> done = new HashSet<Vertex>();
    while(i<j){
      DirectedSparseVertex v = (DirectedSparseVertex)queue.get(i);
      done.add(v);
      Iterator succIt = v.getSuccessors().iterator();
      while(succIt.hasNext()){
        Vertex succ = (Vertex)succIt.next();
        if(!done.contains(succ))
          queue.add(succ);
      }
View Full Code Here

  }

  /** Creates a graph with a single accept-vertex. */
  public static DirectedSparseGraph initialise(){
    DirectedSparseGraph pta = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    pta.setUserDatum(JUConstants.TITLE, "Hypothesis machine", UserData.SHARED);
    pta.addVertex(init);
    DeterministicDirectedSparseGraph.numberVertices(pta);
    return pta;
  }
View Full Code Here

   * @param reject the name of the reject state, to be added to the graph.
   * @return true if any transitions have been added
   */  
  public static boolean completeGraph(DirectedSparseGraph g, String reject)
  {
    DirectedSparseVertex rejectVertex = new DirectedSparseVertex();
    boolean transitionsToBeAdded = false;// whether and new transitions have to be added.
    rejectVertex.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    rejectVertex.addUserDatum(JUConstants.LABEL, reject, UserData.SHARED);
   
    // first pass - computing an alphabet
    Set<String> alphabet = computeAlphabet(g);
   
    // second pass - checking if any transitions need to be added.
View Full Code Here

 
  @Test
  public final void testGetData_Empty1()
  {
    DirectedSparseGraph g = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    init.addUserDatum(JUConstants.LABEL, "A", UserData.SHARED);
    g.addVertex(init);
    PTASequenceEngine engine = new PTA_FSMStructure(new LearnerGraph(g,config));
    vertifyPTA(engine, 1, new String[][] {
        new String[] {}
      });
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.impl.DirectedSparseVertex

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.