Package aima.core.util.datastructure

Examples of aima.core.util.datastructure.Point2D


   */
  static class H2 extends AdaptableHeuristicFunction {

    public double h(Object state) {
      double result = 0.0;
      Point2D pt1 = map.getPosition((String) state);
      Point2D pt2 = map.getPosition((String) goal);
      if (pt1 != null && pt2 != null)
        result = pt1.distance(pt2);
      //System.out.println(state + ": " + result);
      return result;
    }
View Full Code Here


    this.map = map;
  }

  public double h(Object state) {
    double result = 0.0;
    Point2D pt1 = map.getPosition((String) state);
    Point2D pt2 = map.getPosition((String) goal);
    if (pt1 != null && pt2 != null) {
      result = pt1.distance(pt2);
    }
    return result;
  }
View Full Code Here

      }
      visitedStates.clear();
      String[] locs = new String[marks.size()];
      for (int i = 0; i < marks.size(); i++) {
        MapNode node = marks.get(i);
        Point2D pt = new Point2D(node.getLon(), node.getLat());
        locs[i] = map.getNearestLocation(pt);
      }
      heuristic.adaptToGoal(locs[1], map);
      Agent agent = null;
      MapAgentFrame.SelectionState state = frame.getSelection();
View Full Code Here

    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

TOP

Related Classes of aima.core.util.datastructure.Point2D

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.