AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
mdp_algorithm.h
1#ifndef PROBFD_MDP_ALGORITHM_H
2#define PROBFD_MDP_ALGORITHM_H
3
4#include "probfd/policy.h"
5#include "probfd/progress_report.h"
6#include "probfd/type_traits.h"
7
8#include <limits>
9#include <memory>
10
11// Forward Declarations
12namespace probfd {
13template <typename, typename>
14class MDP;
15template <typename>
17class ProgressReport;
18} // namespace probfd
19
20namespace probfd {
21
28template <typename State, typename Action>
30protected:
32
35
36public:
37 virtual ~MDPAlgorithm() = default;
38
42 virtual std::unique_ptr<PolicyType> compute_policy(
43 MDPType& mdp,
44 EvaluatorType& heuristic,
46 ProgressReport progress,
47 double maxtime) = 0;
48
53 virtual Interval solve(
54 MDPType& mdp,
55 EvaluatorType& heuristic,
57 ProgressReport progress,
58 double max_time) = 0;
59
63 virtual void print_statistics(std::ostream&) const {}
64};
65
66} // namespace probfd
67
68#endif // PROBFD_MDP_ALGORITHM_H
The interface representing heuristic functions.
Definition mdp_algorithm.h:16
Interface for MDP algorithm implementations.
Definition mdp_algorithm.h:29
virtual std::unique_ptr< PolicyType > compute_policy(MDPType &mdp, EvaluatorType &heuristic, param_type< State > state, ProgressReport progress, double maxtime)=0
Computes a partial policy for the input state.
virtual Interval solve(MDPType &mdp, EvaluatorType &heuristic, param_type< State > state, ProgressReport progress, double max_time)=0
Runs the MDP algorithm for the initial state state with a maximum time limit.
virtual void print_statistics(std::ostream &) const
Prints algorithm statistics to the specified output stream.
Definition mdp_algorithm.h:63
Basic interface for MDPs.
Definition mdp_algorithm.h:14
A registry for print functions related to search progress.
Definition progress_report.h:33
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
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
Represents a closed interval over the extended reals as a pair of lower and upper bound.
Definition interval.h:12