AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
random_successor_sampler_impl.h
1#include "probfd/successor_samplers/random_successor_sampler.h"
2
3#include "downward/utils/rng.h"
4
6
7template <typename Action>
8RandomSuccessorSampler<Action>::RandomSuccessorSampler(int random_seed)
9 : rng_(std::make_shared<utils::RandomNumberGenerator>(random_seed))
10{
11}
12
13template <typename Action>
14RandomSuccessorSampler<Action>::RandomSuccessorSampler(
15 std::shared_ptr<utils::RandomNumberGenerator> rng)
16 : rng_(std::move(rng))
17{
18}
19
20template <typename Action>
21StateID RandomSuccessorSampler<Action>::sample(
22 StateID,
23 Action,
24 const Distribution<StateID>& successors,
25 algorithms::StateProperties&)
26{
27 return successors.sample(*rng_)->item;
28}
29
30} // namespace probfd::successor_samplers
This namespace contains implementations of transition successor samplers.
Definition arbitrary_sampler.h:7
STL namespace.