|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.planner.GreenhouseHeuristic
public final class GreenhouseHeuristic
The class encapsulates the heuristic function of the A*-algorithm.
The heuristic is calculated by evaluating all rules associated with the requester of the plan. In this way the estimated cost of getting to the goal is very close to the actual distance.
Field Summary | |
---|---|
private double |
baseEuclidianDistance
The base euclidian distance. |
private ClimaticState |
goal
The goal of the search. |
private SuperLinkID |
id
The id of the requester. |
private static org.apache.commons.logging.Log |
logger
Logger for this class |
private ClimaticState |
source
The source of the search. |
Constructor Summary | |
---|---|
GreenhouseHeuristic(SuperLinkID id,
State source,
State goal)
Constructs a new GreenhouseHeuristic with the specified
id . |
Method Summary | |
---|---|
(package private) double |
euclidianDistanceToGoal(ClimaticState state)
Calculates the euclidian distance to the goal state. |
double |
h(State state)
This heuristic is based upon a normalized Euclidian distance. |
private double |
normalizedEuclidian(ClimaticState state)
Calculates the normalized euclidian cost of getting form any state to the goal state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
private final SuperLinkID id
private ClimaticState goal
private ClimaticState source
private double baseEuclidianDistance
distance(source, goal)
.
Constructor Detail |
---|
public GreenhouseHeuristic(SuperLinkID id, State source, State goal)
GreenhouseHeuristic
with the specified
id
.
id
- the id to the requester.source
- the source state of any path in the graphgoal
- the goal state of any path in the graphMethod Detail |
---|
public double h(State state)
This distance is the distance from the current vertex to the goal divided by the distance from source to goal.
h
in interface Heuristic
state
- the input state for the calculation
Heuristic.h(dk.deepthought.sidious.supportsystem.State)
private double normalizedEuclidian(ClimaticState state)
distance(any, goal) / distance(source, goal)
state
- the state to calculate the distance from
double euclidianDistanceToGoal(ClimaticState state)
state
- the source state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |