Package org.encog.ml.graph.search

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


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

TOP

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

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.