AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
probabilistic_successor_generator_factory.h
1#ifndef PROBFD_TASK_UTILS_PROBABILISTIC_SUCCESSOR_GENERATOR_FACTORY_H
2#define PROBFD_TASK_UTILS_PROBABILISTIC_SUCCESSOR_GENERATOR_FACTORY_H
3
4#include <memory>
5#include <utility>
6#include <vector>
7
8// Forward Declarations
9class PlanningTaskProxy;
10
11namespace probfd::successor_generator {
12class ProbabilisticGeneratorBase;
13struct OperatorRange;
14class OperatorInfo;
15} // namespace probfd::successor_generator
16
17namespace probfd::successor_generator {
18
19using GeneratorPtr = std::unique_ptr<ProbabilisticGeneratorBase>;
20
21class ProbabilisticSuccessorGeneratorFactory {
22 using ValuesAndGenerators = std::vector<std::pair<int, GeneratorPtr>>;
23
24 const PlanningTaskProxy& task_proxy_;
25 std::vector<OperatorInfo> operator_infos_;
26
27 [[nodiscard]]
28 GeneratorPtr construct_leaf(OperatorRange range) const;
29
30 [[nodiscard]]
31 GeneratorPtr construct_switch(
32 int switch_var_id,
33 ValuesAndGenerators values_and_generators) const;
34
35 [[nodiscard]]
36 GeneratorPtr construct_recursive(int depth, OperatorRange range) const;
37
38public:
39 explicit ProbabilisticSuccessorGeneratorFactory(
40 const PlanningTaskProxy& task_proxy);
41
42 // Destructor cannot be implicit because OperatorInfo is forward-declared.
43 ~ProbabilisticSuccessorGeneratorFactory();
44
45 GeneratorPtr create();
46};
47
48} // namespace probfd::successor_generator
49
50#endif