Assignment Search Framework
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
NonGoalHeuristic< state_t > Class Template Reference
Inheritance diagram for NonGoalHeuristic< state_t >:

Public Member Functions

 NonGoalHeuristic (const GoalTestFunction< state_t > *g=0, double min_cost=0)
 
virtual ~NonGoalHeuristic ()
 
void setGoalTestFunction (const GoalTestFunction< state_t > *g)
 
void setMinimumActionCost (double min_cost)
 
- Public Member Functions inherited from Heuristic< state_t >
 Heuristic ()
 
virtual ~Heuristic ()
 
virtual void prepareToCompute ()
 
double getHValue (const state_t &state)
 
double getLastHValue () const
 
bool isHValueStored () const
 

Protected Member Functions

virtual double computeHValue (const state_t &state) const
 

Protected Attributes

const GoalTestFunction< state_t > * goal_test
 The stored goal test function. More...
 
double min_action_cost
 The minimum cost of any action. More...
 

Detailed Description

template<class state_t>
class NonGoalHeuristic< state_t >

Defines a heuristic that returns 0 for any goal state, and the minimum action cost for any other state.

Constructor & Destructor Documentation

template<class state_t >
NonGoalHeuristic< state_t >::NonGoalHeuristic ( const GoalTestFunction< state_t > *  g = 0,
double  min_cost = 0 
)

Constructs a non-goal heuristic for the given goal test function and minimum action cost.

Parameters
gThe goal test function. Default is set to none.
min_costThe minimum action cost.
template<class state_t >
NonGoalHeuristic< state_t >::~NonGoalHeuristic ( )
virtual

Destructor for a non-goal heuristic. Destructor is empty.

Member Function Documentation

template<class state_t >
double NonGoalHeuristic< state_t >::computeHValue ( const state_t &  state) const
protectedvirtual

Calculates the heuristic value of the given state. Does not store the heuristic value.

If the heuristic value is negative, the heuristic function is indicating unsolvability.

This is the main function to be overloaded.

Parameters
stateThe state whose heuristic value is to be calculated.
Returns
The heuristic value of the given state.

Implements Heuristic< state_t >.

template<class state_t >
void NonGoalHeuristic< state_t >::setGoalTestFunction ( const GoalTestFunction< state_t > *  g)
inline

Sets the goal test function to the new given function.

Parameters
gThe new goal test function.
template<class state_t >
void NonGoalHeuristic< state_t >::setMinimumActionCost ( double  min_cost)

Sets the minimum action cost to the new minimum cost.

Parameters
min_costThe new minimum cost.

Member Data Documentation

template<class state_t>
const GoalTestFunction<state_t>* NonGoalHeuristic< state_t >::goal_test
protected

The stored goal test function.

template<class state_t>
double NonGoalHeuristic< state_t >::min_action_cost
protected

The minimum cost of any action.


The documentation for this class was generated from the following file: