Package org.geotools.graph.traverse.basic

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


      builder().getGraph(), walker, iterator
    );
    traversal.init();
   
    iterator.setSource(ends[1]);
    traversal.traverse();
   
    //ensure only last node visited
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        if (component == ends[1]) assertTrue(component.isVisited());
View Full Code Here


    DepthFirstTopologicalIterator iterator = createIterator();
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator
    );
    traversal.init();
    traversal.traverse();
   
    assertTrue(walker.getCount() == nnodes);
   
    boolean flip = false;
   
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());
        return 0;
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator
    );
    traversal.init();
    traversal.traverse();
   
    //every node should have been visited
    assertTrue(walker.getCount() == builder().getGraph().getNodes().size());
  }
 
View Full Code Here

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

      }
    };
    builder().getGraph().visitNodes(visitor);
    assertTrue(walker.getCount() == nnodes-suspend+1);
   
    traversal.traverse();
   
    //every node should now be visited
    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();
   
    //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

    };
    builder().getGraph().visitNodes(visitor);
    assertTrue(walker.getCount() == nnodes-kill+1);
   
    //continue, no more nodes should be visited
    traversal.traverse();
 
 
  /**
   * Create a simple graph with a single bifurcation and do a full traversal.
   *
 
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() < bif) {
          assertTrue(component.isVisited())
View Full Code Here

    
     BasicGraphTraversal traversal = new BasicGraphTraversal(
       builder().getGraph(), walker, iterator
     );
     traversal.init();
     traversal.traverse();
    
     //ensure all nodes visisited
     visitor = new GraphVisitor() {
       public int visit(Graphable component) {
         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.