1#ifndef PROBFD_COST_FUNCTION_H
2#define PROBFD_COST_FUNCTION_H
4#include "probfd/type_traits.h"
5#include "probfd/types.h"
6#include "probfd/value_type.h"
19 , terminal_cost_(terminal_cost)
29 return {
false, value};
43 return terminal_cost_;
83template <
typename State,
typename Action>
86 virtual ~CostFunction() =
default;
102template <
typename State,
typename Action>
103class SimpleCostFunction :
public CostFunction<State, Action> {
110 return is_goal(state) ? TerminationInfo::from_goal()
111 : TerminationInfo::from_non_goal(
112 get_non_goal_termination_cost());
117 virtual value_t get_non_goal_termination_cost()
const = 0;
The interface specifying action and state termination costs, aswell as the goal states of a state spa...
Definition fdr_types.h:14
virtual value_t get_action_cost(param_type< Action > action)=0
Gets the cost of an action.
virtual TerminationInfo get_termination_info(param_type< State > state)=0
Returns the cost to terminate in a given state and checks whether a state is a goal.
Specifies the termination cost and goal status of a state.
Definition cost_function.h:13
bool is_goal_state() const
Check if this state is a goal.
Definition cost_function.h:34
value_t get_cost() const
Obtains the cost paid upon termination in the state.
Definition cost_function.h:41
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
double value_t
Typedef for the state value type.
Definition aliases.h:7
typename std::conditional_t< is_cheap_to_copy_v< T >, T, const T & > param_type
Alias template defining the best way to pass a parameter of a given type.
Definition type_traits.h:25