AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
search_space.h
1#ifndef SEARCH_SPACE_H
2#define SEARCH_SPACE_H
3
4#include "downward/operator_cost.h"
5#include "downward/per_state_information.h"
6#include "downward/search_node_info.h"
7
8#include <vector>
9
10class OperatorProxy;
11class State;
12class TaskProxy;
13
14namespace utils {
15class LogProxy;
16}
17
18class SearchNode {
19 State state;
20 SearchNodeInfo& info;
21
22public:
23 SearchNode(const State& state, SearchNodeInfo& info);
24
25 const State& get_state() const;
26
27 bool is_new() const;
28 bool is_open() const;
29 bool is_closed() const;
30 bool is_dead_end() const;
31
32 int get_g() const;
33 int get_real_g() const;
34
35 void open_initial();
36 void open(
37 const SearchNode& parent_node,
38 const OperatorProxy& parent_op,
39 int adjusted_cost);
40 void reopen(
41 const SearchNode& parent_node,
42 const OperatorProxy& parent_op,
43 int adjusted_cost);
44 void update_parent(
45 const SearchNode& parent_node,
46 const OperatorProxy& parent_op,
47 int adjusted_cost);
48 void close();
49 void mark_as_dead_end();
50
51 void dump(const TaskProxy& task_proxy, utils::LogProxy& log) const;
52};
53
54class SearchSpace {
55 PerStateInformation<SearchNodeInfo> search_node_infos;
56
57 StateRegistry& state_registry;
58 utils::LogProxy& log;
59
60public:
61 SearchSpace(StateRegistry& state_registry, utils::LogProxy& log);
62
63 SearchNode get_node(const State& state);
64 void
65 trace_path(const State& goal_state, std::vector<OperatorID>& path) const;
66
67 void dump(const TaskProxy& task_proxy) const;
68 void print_statistics() const;
69};
70
71#endif