Package org.geotools.graph.traverse.basic

Examples of org.geotools.graph.traverse.basic.BasicGraphTraversal.traverse()


     builder().getGraph().visitNodes(visitor);
    
     //ensure nodes only visited once
     assertTrue(walker.getCount() == 2);
    
     traversal.traverse();
    
     //ensure all nodes visited
     visitor = new GraphVisitor() {
       public int visit(Graphable component) {
         assertTrue(component.isVisited());
View Full Code Here


       builder().getGraph(), walker, iterator
     );
     traversal.init();
    
     iterator.setSource(root);
     traversal.traverse();
    
     //ensure that subnodes of first visited after root are not visited
     final String id = (ln.getCount() < rn.getCount()) ?
                   ln.getObject().toString() :
                   rn.getObject().toString();
View Full Code Here

     };
     builder().getGraph().visitNodes(visitor);
    
     //ensure that nodes only visited once
     assertTrue(walker.getCount() == (int)Math.pow(2,k)+1);
     traversal.traverse();
    
     builder().getGraph().visitNodes(visitor);
    
     //ensure that nodes only visited once
     assertTrue(walker.getCount() == (int)Math.pow(2,k)+1);
View Full Code Here

   
    SimpleGraphWalker sgv = new SimpleGraphWalker(graphVisitor);
    GraphIterator iterator = new BreadthFirstIterator();
    BasicGraphTraversal bgt = new BasicGraphTraversal(graph, sgv, iterator);
   
    bgt.traverse();
   
    System.out.println("Found orphans: " + graphVisitor.getCount());
    // visitor example end
}
}
View Full Code Here

    };
   
    GraphTraversal traversal =
      new BasicGraphTraversal(graph,walker,iterator);
    traversal.init();
    traversal.traverse();

    if(sorted.size() != types.size()) {
      throw new RuntimeException("Internal error in schema dependency sort");
    }
View Full Code Here

      
        //if we could not find a source, return false
        if (source == null || source.isVisited()) return(false);
       
        iterator.setSource(source);
        traversal.traverse();
      }
     
      //create the individual graphs
      HashSet nodes = null;
      HashSet edges = null;
View Full Code Here

    //create the traversal that uses the topological iterator
    GraphTraversal traversal = new BasicGraphTraversal(
      m_graph, this, m_iterator
    );
    traversal.init();
    traversal.traverse();
       
    //if all nodes visited then no cycle
    if (m_graph.getNodes().size() == m_nvisited) return(false);
    return(true);
  }
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.