AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
pattern_collection_information.h
1#ifndef PROBFD_PDBS_PATTERN_COLLECTION_INFORMATION_H
2#define PROBFD_PDBS_PATTERN_COLLECTION_INFORMATION_H
3
4#include "probfd/pdbs/subcollection_finder.h"
5#include "probfd/pdbs/types.h"
6
7#include "probfd/fdr_types.h"
8#include "probfd/task_proxy.h"
9
10#include <memory>
11#include <vector>
12
13namespace pdbs {
14class PatternCollectionInformation;
15}
16
17namespace probfd::pdbs {
18
19/*
20 This class contains everything we know about a pattern collection. It will
21 always contain patterns, but can also contain the computed PDBs and
22 additive subsets of the PDBs. If one of the latter is not available, then
23 this information is created when it is requested.
24 Ownership of the information is shared between the creators of this class
25 (usually PatternCollectionGenerators), the class itself, and its users
26 (consumers of pattern collections like heuristics).
27
28 TODO: this should probably re-use PatternInformation and it could also act
29 as an interface for ownership transfer rather than sharing it.
30*/
31class PatternCollectionInformation {
32 ProbabilisticTaskProxy task_proxy_;
33 std::shared_ptr<FDRCostFunction> task_cost_function_;
34
35 std::shared_ptr<PatternCollection> patterns_;
36 std::shared_ptr<PPDBCollection> pdbs_;
37 std::shared_ptr<std::vector<PatternSubCollection>> subcollections_;
38
39 std::shared_ptr<SubCollectionFinder> subcollection_finder_;
40
41 void create_pdbs_if_missing();
42 void create_pattern_cliques_if_missing();
43
44 [[nodiscard]]
45 bool information_is_valid() const;
46
47public:
48 PatternCollectionInformation(
49 const ProbabilisticTaskProxy& task_proxy,
50 std::shared_ptr<FDRCostFunction> task_cost_function,
51 ::pdbs::PatternCollectionInformation det_info,
52 std::shared_ptr<SubCollectionFinder> subcollection_finder);
53
54 PatternCollectionInformation(
55 const ProbabilisticTaskProxy& task_proxy,
56 std::shared_ptr<FDRCostFunction> task_cost_function,
57 std::shared_ptr<PatternCollection> patterns);
58
59 PatternCollectionInformation(
60 const ProbabilisticTaskProxy& task_proxy,
61 std::shared_ptr<FDRCostFunction> task_cost_function,
62 std::shared_ptr<PatternCollection> patterns,
63 std::shared_ptr<SubCollectionFinder> subcollection_finder);
64
65 void set_pdbs(const std::shared_ptr<PPDBCollection>& pdbs);
66 void
67 set_subcollections(const std::shared_ptr<std::vector<PatternSubCollection>>&
68 subcollections);
69
70 [[nodiscard]]
71 std::shared_ptr<PatternCollection> get_patterns() const;
72 std::shared_ptr<PPDBCollection> get_pdbs();
73 std::shared_ptr<std::vector<PatternSubCollection>> get_subcollections();
74 std::shared_ptr<SubCollectionFinder> get_subcollection_finder();
75};
76
77} // namespace probfd::pdbs
78
79#endif // PROBFD_PDBS_PATTERN_COLLECTION_INFORMATION_H
Namespace dedicated to probabilistic pattern databases.
Definition gzocp_heuristic.h:16