001 package aima.search.informed; 002 003 import aima.search.framework.EvaluationFunction; 004 import aima.search.framework.Node; 005 import aima.search.framework.Problem; 006 007 /** 008 * @author Ciaran O'Reilly 009 * 010 */ 011 public class AStarEvaluationFunction implements EvaluationFunction { 012 013 public AStarEvaluationFunction() { 014 } 015 016 public Double getValue(Problem p, Node n) { 017 // f(n) = g(n) + h(n) 018 return new Double(n.getPathCost() 019 + p.getHeuristicFunction().getHeuristicValue(n.getState())); 020 } 021 }