Package org.geotools.graph.traverse.basic

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


    };
    builder().getGraph().visitNodes(visitor);
    assertTrue(walker.getCount() == nnodes-suspend+1);
   
    //resume
    traversal.traverse();
   
    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() <= kill) assertTrue(component.isVisited());
        else assertTrue(!component.isVisited());
View Full Code Here

    };
    builder().getGraph().visitNodes(visitor);
    assertTrue(walker.getCount() == nnodes-kill+1);
   
    //resume
    traversal.traverse();
    builder().getGraph().visitNodes(visitor);
    assertTrue(walker.getCount() == nnodes-kill+1);
  }
 
  /**
 
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());
        String id = component.getObject().toString();
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 != root && component != lc && component != rc)
          assertTrue(!component.isVisited());
View Full Code Here

      }
    };
    builder().getGraph().visitNodes(visitor);
   
    //resume
    traversal.traverse();
   
    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();
   
    GraphVisitor visitor = new GraphVisitor() {
      public int visit(Graphable component) {
        if (component == root || component == lc || component == rc)
          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) {
        Graphable parent = iterator.getParent(component);
        if (component.getID() < 50 && component.getID() > 0) {
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator 
    );
    traversal.init();
    traversal.traverse();
   
    assertTrue(walk.size() == builder().getGraph().getNodes().size());
    assertTrue(walk.isValid() && !walk.isClosed());
   
    //create a new edges in the graph making the graph a cycle
View Full Code Here

   
    BasicGraphTraversal traversal = new BasicGraphTraversal(
      builder().getGraph(), walker, iterator 
    );
    traversal.init();
    traversal.traverse();
   
    assertTrue(walk.getEdges() != null);
    assertTrue(walk.isValid());
  }
 
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.