Package org.encog.ml.graph.search

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


    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");
View Full Code Here


    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);
   
    BreadthFirstSearch search = new BreadthFirstSearch(graph,nodeA,new SimpleDestinationGoal(nodeD));
    Assert.assertEquals(4, countIterations(search));
   
    BasicPath solution = search.getSolution();
    Assert.assertEquals(solution.getNodes().get(0).getLabel(), "a");
    Assert.assertEquals(solution.getNodes().get(1).getLabel(), "b");
View Full Code Here

    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");
View Full Code Here

TOP

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

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.