AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
stable_policy_picker_impl.h
1#include "probfd/distribution.h"
2#include "probfd/transition.h"
3
4namespace probfd::policy_pickers {
5
6template <typename State, typename Action, class Derived>
7StablePolicyPicker<State, Action, Derived>::StablePolicyPicker(
8 bool stable_policy)
9 : stable_policy_(stable_policy)
10{
11}
12
13template <typename State, typename Action, class Derived>
16 std::optional<Action> previous_greedy,
17 const std::vector<Transition<Action>>& greedy_transitions,
19{
20 if (stable_policy_) {
21 for (unsigned i = 0; i < greedy_transitions.size(); ++i) {
22 if (greedy_transitions[i].action == previous_greedy) {
23 return i;
24 }
25 }
26 }
27
28 return static_cast<Derived*>(this)
29 ->pick_index(mdp, previous_greedy, greedy_transitions, properties);
30}
31
32} // namespace probfd::policy_pickers
Basic interface for MDPs.
Definition mdp_algorithm.h:14
Interface providing access to various state properties during heuristic search.
Definition state_properties.h:22
CRTP base class for stable policy picker implementations.
Definition stable_policy_picker.h:12