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

#include "probfd/algorithms/policy_picker.h"

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

Description

template<typename State, typename Action>
class probfd::algorithms::PolicyPicker< State, Action >

An strategy interface used to choose break ties between multiple greedy actions for a state.

This interface is used by heuristic search algorithms which maintain a greedy policy during search. If there are multiple greedy actions in a state after a value update has been performed and the policy needs to be adjusted, an implementation of this interface breaks the ties by choosing one of the candidate greedy actions.

Example

class AlwaysFirstPicker : public PolicyPicker<OperatorID> {
protected:
OperatorID,
const std::vector<OperatorID>&,
const std::vector<Distribution<StateID>>&,
StateProperties&) override
{
return 0; // Always choose the first greedy action in the list
}
};
A convenience class that represents a finite probability distribution.
Definition task_state_space.h:27
Basic interface for MDPs.
Definition mdp_algorithm.h:14
An strategy interface used to choose break ties between multiple greedy actions for a state.
Definition policy_picker.h:57
virtual int pick_index(MDP< State, Action > &mdp, std::optional< Action > incumbent_greedy, const std::vector< Transition< Action > > &greedy_transitions, StateProperties &properties)=0
Selects a greedy transition from multiple candidates by returning its index in the candidate list.
Interface providing access to various state properties during heuristic search.
Definition state_properties.h:22
A StateID represents a state within a StateIDMap. Just like Fast Downward's StateID type,...
Definition types.h:22
Template Parameters
Action- The action type of the underlying MDP model.

Public Member Functions

virtual int pick_index (MDP< State, Action > &mdp, std::optional< Action > incumbent_greedy, const std::vector< Transition< Action > > &greedy_transitions, StateProperties &properties)=0
 Selects a greedy transition from multiple candidates by returning its index in the candidate list.
 
virtual void print_statistics (std::ostream &)
 Prints statistics to an output stream, e.g. the number of queries made to the interface.
 

Member Function Documentation

◆ pick_index()

template<typename State , typename Action >
virtual int probfd::algorithms::PolicyPicker< State, Action >::pick_index ( MDP< State, Action > & mdp,
std::optional< Action > incumbent_greedy,
const std::vector< Transition< Action > > & greedy_transitions,
StateProperties & properties )
pure virtual

◆ print_statistics()

template<typename State , typename Action >
virtual void probfd::algorithms::PolicyPicker< State, Action >::print_statistics ( std::ostream & )
inlinevirtual

Prints statistics to an output stream, e.g. the number of queries made to the interface.