1#ifndef MERGE_AND_SHRINK_MERGE_AND_SHRINK_ALGORITHM_H
2#define MERGE_AND_SHRINK_MERGE_AND_SHRINK_ALGORITHM_H
4#include "downward/utils/logging.h"
14namespace merge_and_shrink {
15class FactoredTransitionSystem;
17class MergeStrategyFactory;
20class MergeAndShrinkAlgorithm {
23 std::shared_ptr<MergeStrategyFactory> merge_strategy_factory;
24 std::shared_ptr<ShrinkStrategy> shrink_strategy;
25 std::shared_ptr<LabelReduction> label_reduction;
31 const int max_states_before_merge;
34 const int shrink_threshold_before_merge;
37 const bool prune_unreachable_states;
38 const bool prune_irrelevant_states;
40 mutable utils::LogProxy log;
41 const double main_loop_max_time;
43 long starting_peak_memory;
45 void report_peak_memory_delta(
bool final =
false)
const;
46 void dump_options()
const;
47 void warn_on_unusual_options()
const;
48 bool ran_out_of_time(
const utils::CountdownTimer& timer)
const;
49 void statistics(
int maximum_intermediate_size)
const;
50 void main_loop(FactoredTransitionSystem& fts,
const TaskProxy& task_proxy);
53 MergeAndShrinkAlgorithm(
54 const std::shared_ptr<MergeStrategyFactory>& merge_strategy,
55 const std::shared_ptr<ShrinkStrategy>& shrink_strategy,
56 const std::shared_ptr<LabelReduction>& label_reduction,
57 bool prune_unreachable_states,
58 bool prune_irrelevant_states,
60 int max_states_before_merge,
61 int threshold_before_merge,
62 double main_loop_max_time,
63 utils::Verbosity verbosity);
64 FactoredTransitionSystem
65 build_factored_transition_system(
const TaskProxy& task_proxy);