Package org.geotools.graph.traverse.basic

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


   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator 
    );
    traversal.init();
    traversal.traverse();
   
    walk.truncate(0);
    assertTrue(walk.isEmpty());
    assertTrue(walk.isValid());
  }
View Full Code Here


   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator 
    );
    traversal.init();
    traversal.traverse();
   
    int size = walk.size();
    walk.truncate(size / 2);
    assertTrue(walk.size() == size / 2);
  }
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator 
    );
    traversal.init();
    traversal.traverse();
   
    int size = walk.size();
    walk.truncate(size / 2);
    assertTrue(walk.size() == size / 2);
  }
View Full Code Here

      builder().getGraph(), walker, iterator
    );
    traversal.init();
   
    iterator.setSource(ends[0]);
    traversal.traverse();
   
    //every node should have been visited
    assertTrue(walker.getCount() == builder().getGraph().getNodes().size());
   
    //ensure nodes only visited once
View Full Code Here

      builder().getGraph(), walker, iterator
    );
    traversal.init();
   
    iterator.setSource(ends[0]);
    traversal.traverse();
   
    //ensure nodes only visited once
    assertTrue(walker.getCount() == nnodes-suspend+1);
   
    //stopping node should be visited and nodes with greater id should not
View Full Code Here

        return(0);
      }
    };
    builder().getGraph().visitNodes(visitor);
   
    traversal.traverse();
   
    //every node should now be visited
    visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        assertTrue(component.isVisited());  
View Full Code Here

      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();
   
    //ensure nodes only visited once
    assertTrue(walker.getCount() == nnodes-kill+1);
 
 
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

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.