Package org.geotools.graph.traverse.basic

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


      builder().getGraph(), walker, iterator
    );
    traversal.init();
   
    iterator.setSource(ends[0]);
    traversal.traverse();
   
    //kill node should be visited and nodes with greater id should not
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        if (component.getID() <= kill) assertTrue(component.isVisited());
View Full Code Here


   
    //ensure nodes only visited once
    assertTrue(walker.getCount() == nnodes-kill+1);
   
    //continue, no more nodes should be visited
    traversal.traverse();
 
 
  /**
   * Create a balanced binary tree and do a normal traversal starting at root.
   * <BR>
 
View Full Code Here

       builder().getGraph(), walker, iterator
     );
     traversal.init();
    
     iterator.setSource(root);
     traversal.traverse();
    
     GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        //ensure component visited
        assertTrue(component.isVisited());
View Full Code Here

       builder().getGraph(), walker, iterator
     );
     traversal.init();
    
     iterator.setSource(root);
     traversal.traverse();
    
     //ensure that only root and one of children is visited
     assertTrue(root.isVisited());
     assertTrue(
       (rn.isVisited() && !ln.isVisited()) ||
View Full Code Here

         return(0);
       }
     };
     builder().getGraph().visitNodes(visitor);
    
     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);
     assertTrue(walker.getCount() == (int)Math.pow(2,k)+1);
    
     traversal.traverse();
    
     builder().getGraph().visitNodes(visitor);
     assertTrue(walker.getCount() == (int)Math.pow(2,k)+1);
   }
  
View Full Code Here

       builder().getGraph(), walker, iterator
     );
     traversal.init();
    
     iterator.setSource(source);
     traversal.traverse();
    
     //ensure all nodes visisited
     visitor = new GraphVisitor() {
       public int visit(Graphable component) {
         assertTrue(component.isVisited());
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator
    );
    traversal.init();
    traversal.traverse();
   
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        assertTrue(component.isVisited());
        assertTrue(iterator.getCost(component) == (double)component.getID());
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator
    );
    traversal.init();
    traversal.traverse();
   
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        if (component.getID() <= suspend) assertTrue(component.isVisited());
        else assertTrue(!component.isVisited());
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.