AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
eager_search.h
1#ifndef SEARCH_ALGORITHMS_EAGER_SEARCH_H
2#define SEARCH_ALGORITHMS_EAGER_SEARCH_H
3
4#include "downward/open_list.h"
5#include "downward/search_algorithm.h"
6
7#include <memory>
8#include <vector>
9
10class Evaluator;
11class PruningMethod;
12class OpenListFactory;
13
14namespace eager_search {
15class EagerSearch : public SearchAlgorithm {
16 const bool reopen_closed_nodes;
17
18 std::unique_ptr<StateOpenList> open_list;
19 std::shared_ptr<Evaluator> f_evaluator;
20
21 std::vector<Evaluator*> path_dependent_evaluators;
22 std::vector<std::shared_ptr<Evaluator>> preferred_operator_evaluators;
23 std::shared_ptr<Evaluator> lazy_evaluator;
24
25 std::shared_ptr<PruningMethod> pruning_method;
26
27 void start_f_value_statistics(EvaluationContext& eval_context);
28 void update_f_value_statistics(EvaluationContext& eval_context);
29 void reward_progress();
30
31protected:
32 virtual void initialize() override;
33 virtual SearchStatus step() override;
34
35public:
36 explicit EagerSearch(
37 const std::shared_ptr<OpenListFactory>& open,
38 bool reopen_closed,
39 const std::shared_ptr<Evaluator>& f_eval,
40 const std::vector<std::shared_ptr<Evaluator>>& preferred,
41 const std::shared_ptr<PruningMethod>& pruning,
42 const std::shared_ptr<Evaluator>& lazy_evaluator,
43 OperatorCost cost_type,
44 int bound,
45 double max_time,
46 const std::string& description,
47 utils::Verbosity verbosity);
48
49 virtual void print_statistics() const override;
50
51 void dump_search_space() const;
52};
53
54} // namespace eager_search
55
56#endif