AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
ff_heuristic.h
1#ifndef HEURISTICS_FF_HEURISTIC_H
2#define HEURISTICS_FF_HEURISTIC_H
3
4#include "downward/heuristics/additive_heuristic.h"
5
6#include <vector>
7
8namespace ff_heuristic {
9using relaxation_heuristic::OpID;
10using relaxation_heuristic::PropID;
11
12using relaxation_heuristic::NO_OP;
13
14using relaxation_heuristic::Proposition;
15using relaxation_heuristic::UnaryOperator;
16
17/*
18 TODO: In a better world, this should not derive from
19 AdditiveHeuristic. Rather, the common parts should be
20 implemented in a common base class. That refactoring could be
21 made at the same time at which we also unify this with the
22 other relaxation heuristics and the additional FF heuristic
23 implementation in the landmark code.
24*/
25class FFHeuristic : public additive_heuristic::AdditiveHeuristic {
26 // Relaxed plans are represented as a set of operators implemented
27 // as a bit vector.
28 using RelaxedPlan = std::vector<bool>;
29 RelaxedPlan relaxed_plan;
30 void mark_preferred_operators_and_relaxed_plan(
31 const State& state,
32 PropID goal_id);
33
34protected:
35 virtual int compute_heuristic(const State& ancestor_state) override;
36
37public:
38 FFHeuristic(
39 const std::shared_ptr<AbstractTask>& transform,
40 bool cache_estimates,
41 const std::string& description,
42 utils::Verbosity verbosity);
43};
44} // namespace ff_heuristic
45
46#endif