1#ifndef LANDMARKS_LANDMARK_FACTORY_RPG_SASP_H
2#define LANDMARKS_LANDMARK_FACTORY_RPG_SASP_H
4#include "downward/landmarks/landmark_factory_relaxation.h"
6#include <unordered_map>
7#include <unordered_set>
11class LandmarkFactoryRpgSasp :
public LandmarkFactoryRelaxation {
12 const bool disjunctive_landmarks;
13 const bool use_orders;
14 const bool only_causal_landmarks;
15 std::list<LandmarkNode*> open_landmarks;
16 std::vector<std::vector<int>> disjunction_classes;
18 std::unordered_map<LandmarkNode*, utils::HashSet<FactPair>> forward_orders;
22 std::vector<std::vector<std::unordered_set<int>>> dtg_successors;
24 void build_dtg_successors(
const TaskProxy& task_proxy);
25 void add_dtg_successor(
int var_id,
int pre,
int post);
26 void find_forward_orders(
27 const VariablesProxy& variables,
28 const std::vector<std::vector<bool>>& reached,
29 LandmarkNode* lm_node);
30 void add_lm_forward_orders();
32 void get_greedy_preconditions_for_lm(
33 const TaskProxy& task_proxy,
34 const Landmark& landmark,
35 const AxiomOrOperatorProxy& op,
36 std::unordered_map<int, int>& result)
const;
37 void compute_shared_preconditions(
38 const TaskProxy& task_proxy,
39 std::unordered_map<int, int>& shared_pre,
40 std::vector<std::vector<bool>>& reached,
41 const Landmark& landmark);
42 void compute_disjunctive_preconditions(
43 const TaskProxy& task_proxy,
44 std::vector<std::set<FactPair>>& disjunctive_pre,
45 std::vector<std::vector<bool>>& reached,
46 const Landmark& landmark);
48 virtual void generate_relaxed_landmarks(
49 const std::shared_ptr<AbstractTask>& task,
50 Exploration& exploration)
override;
52 found_simple_lm_and_order(
const FactPair& a, LandmarkNode& b, EdgeType t);
53 void found_disj_lm_and_order(
54 const TaskProxy& task_proxy,
55 const std::set<FactPair>& a,
58 void approximate_lookahead_orders(
59 const TaskProxy& task_proxy,
60 const std::vector<std::vector<bool>>& reached,
62 bool domain_connectivity(
63 const State& initial_state,
64 const FactPair& landmark,
65 const std::unordered_set<int>& exclude);
67 void build_disjunction_classes(
const TaskProxy& task_proxy);
69 void discard_disjunctive_landmarks();
72 LandmarkFactoryRpgSasp(
73 bool disjunctive_landmarks,
75 bool only_causal_landmarks,
76 utils::Verbosity verbosity);
78 virtual bool supports_conditional_effects()
const override;