com.thesett.aima.search.util.informed.HeuristicSearchNode Maven / Gradle / Ivy
/*
* Copyright The Sett Ltd, 2005 to 2014.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thesett.aima.search.util.informed;
import com.thesett.aima.search.SearchNode;
import com.thesett.aima.search.SearchNotExhaustiveException;
import com.thesett.aima.search.Successor;
import com.thesett.aima.search.Traversable;
/**
* HeuristicSearchNode extends {@link SearchNode} with heuristic evaluations of search states. In addition to the
* properties provided by SearchNode it provides two values, h and f. Both are real valued (floats). h is the heuristic
* value and f is the heuristic value plus the search path cost required to reach a given state.
*
*
CRC Card
* Responsibilities Collaborations
* Calculate h and f
*
*
* @author Rupert Smith
*/
public class HeuristicSearchNodeNote that this constructor does not set up the heuristic evaluator or calculate the value of h. These steps
* are performed by the {@link #makeNode} method which should always be called after using this constructor.
*/
public HeuristicSearchNode()
{
}
/**
* Makes a search node for startState that uses the supplied heuristic.
*
* @param startState The search state space to create a heuristic search node for.
* @param heuristic The heuristic calculation to use for the search node.
*/
public HeuristicSearchNode(T startState, Heuristic