AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
most_likely_sampler_impl.h
1#include "probfd/successor_samplers/most_likely_sampler.h"
2
3#include "probfd/distribution.h"
4
6
7template <typename Action>
8StateID MostLikelySuccessorSampler<Action>::sample(
9 StateID,
10 Action,
11 const Distribution<StateID>& successors,
12 algorithms::StateProperties&)
13{
14 value_t max = -INFINITE_VALUE;
15
16 StateID res;
17
18 for (const auto& [item, probability] : successors) {
19 if (probability > max) {
20 max = probability;
21 res = item;
22 }
23 }
24
25 return res;
26}
27
28} // namespace probfd::successor_samplers
This namespace contains implementations of transition successor samplers.
Definition arbitrary_sampler.h:7
double value_t
Typedef for the state value type.
Definition aliases.h:7