AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
random_tiebreaker.h
1#ifndef PROBFD_POLICY_PICKER_RANDOM_TIEBREAKER_H
2#define PROBFD_POLICY_PICKER_RANDOM_TIEBREAKER_H
3
4#include "probfd/policy_pickers/stable_policy_picker.h"
5
6#include <memory>
7
8// Forward Declarations
9namespace utils {
10class RandomNumberGenerator;
11}
12
13namespace probfd::policy_pickers {
14
15template <typename State, typename Action>
16class RandomTiebreaker
17 : public StablePolicyPicker<
18 State,
19 Action,
20 RandomTiebreaker<State, Action>> {
21 std::shared_ptr<utils::RandomNumberGenerator> rng_;
22
23public:
24 explicit RandomTiebreaker(bool stable_policy, int random_seed);
25 explicit RandomTiebreaker(
26 bool stable_policy,
27 std::shared_ptr<utils::RandomNumberGenerator> rng);
28
29 int pick_index(
30 MDP<State, Action>& mdp,
31 std::optional<Action> prev_policy,
32 const std::vector<Transition<Action>>& greedy_transitions,
33 algorithms::StateProperties& properties);
34};
35
36} // namespace probfd::policy_pickers
37
38#include "probfd/policy_pickers/random_tiebreaker_impl.h"
39
40#endif // PROBFD_POLICY_PICKER_RANDOM_TIEBREAKER_H