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 PDBS_PATTERN_COLLECTION_INFORMATION_H
2#define PDBS_PATTERN_COLLECTION_INFORMATION_H
3
4#include "downward/pdbs/types.h"
5
6#include "downward/task_proxy.h"
7
8#include <memory>
9
10namespace utils {
11class LogProxy;
12}
13
14namespace pdbs {
15/*
16 This class contains everything we know about a pattern collection. It will
17 always contain patterns, but can also contain the computed PDBs and maximal
18 additive subsets of the PDBs. If one of the latter is not available, then
19 this information is created when it is requested.
20 Ownership of the information is shared between the creators of this class
21 (usually PatternCollectionGenerators), the class itself, and its users
22 (consumers of pattern collections like heuristics).
23
24 TODO: this should probably re-use PatternInformation and it could also act
25 as an interface for ownership transfer rather than sharing it.
26*/
27class PatternCollectionInformation {
28 TaskProxy task_proxy;
29 std::shared_ptr<PatternCollection> patterns;
30 std::shared_ptr<PDBCollection> pdbs;
31 std::shared_ptr<std::vector<PatternClique>> pattern_cliques;
32 utils::LogProxy& log;
33
34 void create_pdbs_if_missing();
35 void create_pattern_cliques_if_missing();
36
37 bool information_is_valid() const;
38
39public:
40 PatternCollectionInformation(
41 const TaskProxy& task_proxy,
42 const std::shared_ptr<PatternCollection>& patterns,
43 utils::LogProxy& log);
44 ~PatternCollectionInformation() = default;
45
46 void set_pdbs(const std::shared_ptr<PDBCollection>& pdbs);
47 void set_pattern_cliques(
48 const std::shared_ptr<std::vector<PatternClique>>& pattern_cliques);
49
50 TaskProxy get_task_proxy() const { return task_proxy; }
51
52 std::shared_ptr<PatternCollection> get_patterns() const;
53 std::shared_ptr<PDBCollection> get_pdbs();
54 std::shared_ptr<std::vector<PatternClique>> get_pattern_cliques();
55};
56} // namespace pdbs
57
58#endif