AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
ao_star.h
1#ifndef PROBFD_ALGORITHMS_AO_STAR_H
2#define PROBFD_ALGORITHMS_AO_STAR_H
3
4#include "probfd/algorithms/ao_search.h"
5
6#include <vector>
7
8// Forward Declarations
9namespace probfd::algorithms {
10template <typename>
11class SuccessorSampler;
12}
13
16
38template <typename State, typename Action, bool UseInterval>
39class AOStar
40 : public AOBase<
41 State,
42 Action,
43 PerStateInformation<Action, UseInterval, true>> {
44 using Base = typename AOStar::AOBase;
45
46 friend Base;
47
48 using AlgorithmValueType = Base::AlgorithmValueType;
49
50 using MDPType = typename Base::MDPType;
51 using EvaluatorType = typename Base::EvaluatorType;
52 using PolicyPickerType = typename Base::PolicyPickerType;
53 using StateInfo = typename Base::StateInfo;
54
56
57 // Algorithm parameters
58 const std::shared_ptr<SuccessorSamplerType> outcome_selection_;
59
60 // Re-used buffers
61 std::vector<Transition<Action>> transitions_;
62 std::vector<AlgorithmValueType> qvalues_;
63 Distribution<StateID> successor_dist_;
64
65public:
66 AOStar(
67 std::shared_ptr<PolicyPickerType> policy_chooser,
68 std::shared_ptr<SuccessorSamplerType> outcome_selection);
69
70protected:
71 Interval do_solve(
72 MDPType& mdp,
73 EvaluatorType& heuristic,
74 param_type<State> initial_state,
75 ProgressReport& progress,
76 double max_time) override;
77
78private:
79 bool update_value_check_solved(
80 MDPType& mdp,
82 std::vector<Transition<Action>> transitions,
83 StateInfo& info);
84};
85
86} // namespace probfd::algorithms::ao_search::ao_star
87
88#define GUARD_INCLUDE_PROBFD_ALGORITHMS_AO_STAR_H
89#include "probfd/algorithms/ao_star_impl.h"
90#undef GUARD_INCLUDE_PROBFD_ALGORITHMS_AO_STAR_H
91
92#endif // PROBFD_ALGORITHMS_AO_STAR_H
A convenience class that represents a finite probability distribution.
Definition task_state_space.h:27
A registry for print functions related to search progress.
Definition progress_report.h:33
Base class for the AO* algorithm family.
Definition ao_search.h:85
Implementation of the AO* algorithm.
Definition ao_star.h:43
Namespace dedicated to the AO* algorithm.
Definition ao_star.h:15
This namespace contains implementations of SSP search algorithms.
Definition acyclic_value_iteration.h:22
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