AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
stubborn_sets_action_centric.h
1#ifndef PRUNING_STUBBORN_SETS_ACTION_CENTRIC_H
2#define PRUNING_STUBBORN_SETS_ACTION_CENTRIC_H
3
4#include "downward/pruning/stubborn_sets.h"
5
6namespace stubborn_sets {
7class StubbornSetsActionCentric : public stubborn_sets::StubbornSets {
8 /*
9 stubborn_queue contains the operator indices of operators that
10 have been marked as stubborn but have not yet been processed
11 (i.e. more operators might need to be added to stubborn because
12 of the operators in the queue).
13 */
14 std::vector<int> stubborn_queue;
15
16 virtual void initialize_stubborn_set(const State& state) = 0;
17 virtual void handle_stubborn_operator(const State& state, int op_no) = 0;
18 virtual void compute_stubborn_set(const State& state) override;
19
20protected:
21 explicit StubbornSetsActionCentric(utils::Verbosity verbosity);
22 bool can_disable(int op1_no, int op2_no) const;
23 bool can_conflict(int op1_no, int op2_no) const;
24
25 /*
26 Return the first unsatified goal pair,
27 or FactPair::no_fact if there is none.
28
29 Note that we use a sorted list of goals here intentionally.
30 (See comment on find_unsatisfied_precondition.)
31 */
32 FactPair find_unsatisfied_goal(const State& state) const
33 {
34 return find_unsatisfied_condition(sorted_goals, state);
35 }
36
37 // Return true iff the operator was enqueued.
38 bool enqueue_stubborn_operator(int op_no);
39};
40} // namespace stubborn_sets
41
42#endif