1#ifndef SEARCH_ALGORITHMS_ENFORCED_HILL_CLIMBING_SEARCH_H
2#define SEARCH_ALGORITHMS_ENFORCED_HILL_CLIMBING_SEARCH_H
4#include "downward/evaluation_context.h"
5#include "downward/open_list.h"
6#include "downward/search_algorithm.h"
14namespace enforced_hill_climbing_search {
15enum class PreferredUsage { PRUNE_BY_PREFERRED, RANK_PREFERRED_FIRST };
24class EnforcedHillClimbingSearch :
public SearchAlgorithm {
25 std::unique_ptr<EdgeOpenList> open_list;
27 std::shared_ptr<Evaluator> evaluator;
28 std::vector<std::shared_ptr<Evaluator>> preferred_operator_evaluators;
29 std::set<Evaluator*> path_dependent_evaluators;
31 PreferredUsage preferred_usage;
33 EvaluationContext current_eval_context;
34 int current_phase_start_g;
37 std::map<int, std::pair<int, int>> d_counts;
39 int last_num_expanded;
41 void insert_successor_into_open_list(
42 const EvaluationContext& eval_context,
46 void expand(EvaluationContext& eval_context);
47 void reach_state(
const State& parent, OperatorID op_id,
const State& state);
51 virtual void initialize()
override;
52 virtual SearchStatus step()
override;
55 EnforcedHillClimbingSearch(
56 const std::shared_ptr<Evaluator>& h,
57 PreferredUsage preferred_usage,
58 const std::vector<std::shared_ptr<Evaluator>>& preferred,
59 OperatorCost cost_type,
62 const std::string& description,
63 utils::Verbosity verbosity);
65 virtual void print_statistics()
const override;