Package org.encog.ml.graph.search

Examples of org.encog.ml.graph.search.DepthFirstSearch


    BasicNode nodeB = graph.connect(nodeA,new BasicNode("b"),5);
    BasicNode nodeC = graph.connect(nodeA,new BasicNode("c"),2);
    BasicNode nodeD = graph.connect(nodeB, new BasicNode("d"), 1);
    nodeC.connect(nodeD, 1);
   
    DepthFirstSearch search = new DepthFirstSearch(graph,nodeA,new SimpleDestinationGoal(nodeD));
    Assert.assertEquals(3, countIterations(search));
   
    BasicPath solution = search.getSolution();
    Assert.assertEquals(solution.getNodes().get(0).getLabel(), "a");
    Assert.assertEquals(solution.getNodes().get(1).getLabel(), "b");
    Assert.assertEquals(solution.getNodes().get(2).getLabel(), "d");
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.graph.search.DepthFirstSearch

Copyright © 2018 www.massapicom. 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.