AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
shrink_strategy.h
1#ifndef MERGE_AND_SHRINK_SHRINK_STRATEGY_H
2#define MERGE_AND_SHRINK_SHRINK_STRATEGY_H
3
4#include "downward/merge_and_shrink/types.h"
5
6#include <string>
7#include <vector>
8
9namespace utils {
10class LogProxy;
11}
12
13namespace merge_and_shrink {
14class Distances;
15class TransitionSystem;
16
17class ShrinkStrategy {
18protected:
19 virtual std::string name() const = 0;
20 virtual void dump_strategy_specific_options(utils::LogProxy& log) const = 0;
21
22public:
23 ShrinkStrategy() = default;
24 virtual ~ShrinkStrategy() = default;
25
26 /*
27 Compute a state equivalence relation over the states of the given
28 transition system such that its new number of states after abstracting
29 it according to this equivalence relation is at most target_size
30 (currently violated; see issue250). dist must be the distances
31 information associated with the given transition system.
32
33 Note that if target_size equals the current size of the transition system,
34 the shrink strategy is not required to compute an equivalence relation
35 that results in actually shrinking the size of the transition system.
36 However, it may attempt to e.g. compute an equivalence relation that
37 results in shrinking the transition system in an information-preserving
38 way.
39 */
40 virtual StateEquivalenceRelation compute_equivalence_relation(
41 const TransitionSystem& ts,
42 const Distances& distances,
43 int target_size,
44 utils::LogProxy& log) const = 0;
45 virtual bool requires_init_distances() const = 0;
46 virtual bool requires_goal_distances() const = 0;
47
48 void dump_options(utils::LogProxy& log) const;
49 std::string get_name() const;
50};
51} // namespace merge_and_shrink
52
53#endif