AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
merge_and_shrink_heuristic.h
1#ifndef MERGE_AND_SHRINK_MERGE_AND_SHRINK_HEURISTIC_H
2#define MERGE_AND_SHRINK_MERGE_AND_SHRINK_HEURISTIC_H
3
4#include "downward/heuristic.h"
5
6#include <memory>
7
8namespace merge_and_shrink {
9class FactoredTransitionSystem;
10class MergeAndShrinkRepresentation;
11
12class MergeStrategyFactory;
13class ShrinkStrategy;
14class LabelReduction;
15
16class MergeAndShrinkHeuristic : public Heuristic {
17 // The final merge-and-shrink representations, storing goal distances.
18 std::vector<std::unique_ptr<MergeAndShrinkRepresentation>>
19 mas_representations;
20
21 void extract_factor(FactoredTransitionSystem& fts, int index);
22 bool extract_unsolvable_factor(FactoredTransitionSystem& fts);
23 void extract_nontrivial_factors(FactoredTransitionSystem& fts);
24 void extract_factors(FactoredTransitionSystem& fts);
25
26protected:
27 virtual int compute_heuristic(const State& ancestor_state) override;
28
29public:
30 MergeAndShrinkHeuristic(
31 const std::shared_ptr<MergeStrategyFactory>& merge_strategy,
32 const std::shared_ptr<ShrinkStrategy>& shrink_strategy,
33 const std::shared_ptr<LabelReduction>& label_reduction,
34 bool prune_unreachable_states,
35 bool prune_irrelevant_states,
36 int max_states,
37 int max_states_before_merge,
38 int threshold_before_merge,
39 double main_loop_max_time,
40 const std::shared_ptr<AbstractTask>& transform,
41 bool cache_estimates,
42 const std::string& description,
43 utils::Verbosity verbosity);
44
45 ~MergeAndShrinkHeuristic() override;
46};
47} // namespace merge_and_shrink
48
49#endif