AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
probfd::StateSpace< State, Action > Class Template Referenceabstract

#include "probfd/state_space.h"

Inheritance diagram for probfd::StateSpace< State, Action >:
[legend]

Description

template<typename State, typename Action>
class probfd::StateSpace< State, Action >

An interface representing a Markov Decision Process (MDP) without objective function.

This interface has four responsibilities:

  1. The translation between states and state IDs. While states can be large explicit representations, StateIDs are cheap to store and copy.
  2. The computation of the set of actions applicable in a state.
  3. The computation of the transitions of the MDP.
Template Parameters
State- The state type of the MDP.
Action- The action type of the MDP.

Public Member Functions

virtual StateID get_state_id (param_type< State > state)=0
 Get the state ID 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 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.
 
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 void generate_all_transitions (param_type< State > state, std::vector< TransitionType > &transitions)=0
 Generates all applicable actions and their corresponding successor distributions for a given state.
 

Member Function Documentation

◆ get_state_id()

template<typename State , typename Action >
virtual StateID probfd::StateSpace< State, Action >::get_state_id ( param_type< State > state)
pure virtual

Get the state ID for a given state.

Implemented in probfd::CompositeMDP< State, Action >.

◆ get_state()

template<typename State , typename Action >
virtual State probfd::StateSpace< State, Action >::get_state ( StateID state_id)
pure virtual

Get the state mapped to a given state ID.

Implemented in probfd::CompositeMDP< State, Action >, and probfd::pdbs::ProjectionStateSpace.

◆ generate_applicable_actions()

template<typename State , typename Action >
virtual void probfd::StateSpace< State, Action >::generate_applicable_actions ( param_type< State > state,
std::vector< Action > & result )
pure virtual

Generates the applicable actions of the state.

Implemented in probfd::CompositeMDP< State, Action >.

◆ generate_action_transitions()

template<typename State , typename Action >
virtual void probfd::StateSpace< State, Action >::generate_action_transitions ( param_type< State > state,
param_type< Action > action,
Distribution< StateID > & result )
pure virtual

Generates the successor distribution for a given state and action.

Implemented in probfd::CompositeMDP< State, Action >.

◆ generate_all_transitions() [1/2]

template<typename State , typename Action >
virtual void probfd::StateSpace< State, Action >::generate_all_transitions ( param_type< State > state,
std::vector< Action > & aops,
std::vector< Distribution< StateID > > & successors )
pure virtual

Generates all applicable actions and their corresponding successor distributions for a given state.

Implemented in probfd::CompositeMDP< State, Action >.

◆ generate_all_transitions() [2/2]

template<typename State , typename Action >
virtual void probfd::StateSpace< State, Action >::generate_all_transitions ( param_type< State > state,
std::vector< TransitionType > & transitions )
pure virtual

Generates all applicable actions and their corresponding successor distributions for a given state.

Implemented in probfd::CompositeMDP< State, Action >.