AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
landmark_factory_relaxation.h
1#ifndef LANDMARKS_LANDMARK_FACTORY_RELAXATION_H
2#define LANDMARKS_LANDMARK_FACTORY_RELAXATION_H
3
4#include "downward/landmarks/landmark_factory.h"
5
6namespace landmarks {
7class Exploration;
8
9class LandmarkFactoryRelaxation : public LandmarkFactory {
10protected:
11 explicit LandmarkFactoryRelaxation(utils::Verbosity verbosity);
12
13 /*
14 Test whether the relaxed planning task is solvable without
15 achieving the excluded landmark.
16 */
17 bool relaxed_task_solvable(
18 const TaskProxy& task_proxy,
19 Exploration& exploration,
20 const Landmark& exclude) const;
21 /*
22 Compute for each fact whether it is relaxed reachable without
23 achieving the excluded landmark.
24 */
25 std::vector<std::vector<bool>> compute_relaxed_reachability(
26 Exploration& exploration,
27 const Landmark& exclude) const;
28
29private:
30 void generate_landmarks(const std::shared_ptr<AbstractTask>& task) override;
31
32 virtual void generate_relaxed_landmarks(
33 const std::shared_ptr<AbstractTask>& task,
34 Exploration& exploration) = 0;
35 void postprocess(const TaskProxy& task_proxy, Exploration& exploration);
36
37 void calc_achievers(const TaskProxy& task_proxy, Exploration& exploration);
38
39protected:
40 /*
41 The method discard_noncausal_landmarks assumes the graph has no
42 conjunctive landmarks, and will not process conjunctive landmarks
43 correctly.
44 */
45 void discard_noncausal_landmarks(
46 const TaskProxy& task_proxy,
47 Exploration& exploration);
48 /*
49 A landmark is causal if it is a goal or it is a precondition of an
50 action that must be applied in order to reach the goal.
51 */
52 bool is_causal_landmark(
53 const TaskProxy& task_proxy,
54 Exploration& exploration,
55 const Landmark& landmark) const;
56};
57} // namespace landmarks
58
59#endif