4#include "probfd/cost_function.h"
5#include "probfd/state_space.h"
12template <
typename State,
typename Action>
14 :
public StateSpace<State, Action>
15 ,
public CostFunction<State, Action> {
20 virtual void print_statistics()
const {}
26template <
typename State,
typename Action>
31 return is_goal(state) ? TerminationInfo::from_goal()
32 : TerminationInfo::from_non_goal(
33 get_non_goal_termination_cost());
38 virtual value_t get_non_goal_termination_cost()
const = 0;
47template <
typename State,
typename Action>
49 using TransitionType = Transition<Action>;
57 : state_space(state_space)
58 , cost_function(cost_function)
83 std::vector<Action>& result)
final
105 std::vector<Action>& aops,
113 std::vector<TransitionType>& transitions)
final
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.
A convenience class that represents a finite probability distribution.
Definition task_state_space.h:27
Basic interface for MDPs.
Definition mdp_algorithm.h:14
Basic interface for MDPs.
Definition mdp.h:27
TerminationInfo get_termination_info(param_type< State > state) final
Returns the cost to terminate in a given state and checks whether a state is a goal.
Definition mdp.h:29
An interface representing a Markov Decision Process (MDP) without objective function.
Definition state_space.h:44
virtual void generate_all_transitions(param_type< State > state, std::vector< Action > &aops, std::vector< Distribution< StateID > > &successors)=0
Generates all applicable actions and their corresponding successor distributions for a given state.
virtual State get_state(StateID state_id)=0
Get the state mapped to a given state ID.
virtual void generate_applicable_actions(param_type< State > state, std::vector< Action > &result)=0
Generates the applicable actions of the state.
virtual StateID get_state_id(param_type< State > state)=0
Get the state ID for a given state.
virtual void generate_action_transitions(param_type< State > state, param_type< Action > action, Distribution< StateID > &result)=0
Generates the successor distribution for a given state and action.
Specifies the termination cost and goal status of a state.
Definition cost_function.h:13
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
Composes a state space and a cost function to an MDP.
Definition mdp.h:48
State get_state(StateID state_id) final
Get the state mapped to a given state ID.
Definition mdp.h:73
virtual void generate_all_transitions(param_type< State > state, std::vector< TransitionType > &transitions) final
Generates all applicable actions and their corresponding successor distributions for a given state.
Definition mdp.h:111
value_t get_action_cost(param_type< Action > action) final
Gets the action cost of a state-action.
Definition mdp.h:132
StateID get_state_id(param_type< State > state) final
Get the state ID for a given state.
Definition mdp.h:65
void generate_action_transitions(param_type< State > state, param_type< Action > action, Distribution< StateID > &result) final
Generates the successor distribution for a given state and action.
Definition mdp.h:91
void generate_applicable_actions(param_type< State > state, std::vector< Action > &result) final
Generates the applicable actions of the state.
Definition mdp.h:81
TerminationInfo get_termination_info(param_type< State > state) final
Returns the cost to terminate in a given state and checks whether a state is a goal.
Definition mdp.h:124
void generate_all_transitions(param_type< State > state, std::vector< Action > &aops, std::vector< Distribution< StateID > > &successors) final
Generates all applicable actions and their corresponding successor distributions for a given state.
Definition mdp.h:103
A StateID represents a state within a StateIDMap. Just like Fast Downward's StateID type,...
Definition types.h:22