Examples of HeuristicFunction


Examples of aima.core.search.framework.HeuristicFunction

      result.add(new Position(fromRNode.getLat(), fromRNode.getLon()));
      for (int i = 1; i < locs.size()
          && !CancelableThread.currIsCanceled(); i++) {
        MapNode toRNode = mapData.getNearestWayNode(new Position(locs
            .get(i)), wayFilter);
        HeuristicFunction hf = createHeuristicFunction(toRNode,
            waySelection);
        Problem problem = createProblem(fromRNode, toRNode, mapData,
            wayFilter, ignoreOneways, waySelection);
        Search search = new AStarSearch(new GraphSearch(), hf);
        List<Action> actions = search.search(problem);
View Full Code Here

Examples of aima.core.search.framework.HeuristicFunction

  public void setUp() {
    envChanges = new StringBuffer();

    aMap = new SimplifiedRoadMapOfPartOfRomania();

    HeuristicFunction heuristicFunction = new HeuristicFunction() {
      public double h(Object state) {
        Point2D pt1 = aMap.getPosition((String) state);
        Point2D pt2 = aMap
            .getPosition(SimplifiedRoadMapOfPartOfRomania.BUCHAREST);
        return pt1.distance(pt2);
View Full Code Here

Examples of aima.core.search.framework.HeuristicFunction

    Problem problem = new Problem("start",
        MapFunctionFactory.getActionsFunction(map),
        MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
            "goal"), new MapStepCostFunction(map));

    HeuristicFunction hf = new HeuristicFunction() {
      public double h(Object state) {
        return 0; // Don't have one for this test
      }
    };
    Search search = new AStarSearch(new GraphSearch(), hf);
View Full Code Here

Examples of aima.core.search.framework.HeuristicFunction

    aMap.addBidirectionalLink("A", "B", 4.0);
    aMap.addBidirectionalLink("B", "C", 4.0);
    aMap.addBidirectionalLink("C", "D", 4.0);
    aMap.addBidirectionalLink("D", "E", 4.0);
    aMap.addBidirectionalLink("E", "F", 4.0);
    hf = new HeuristicFunction() {
      public double h(Object state) {
        return 1;
      }
    };
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.