AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
match_tree.h
1#ifndef PROBFD_PDBS_MATCH_TREE_H
2#define PROBFD_PDBS_MATCH_TREE_H
3
4#include "probfd/fdr_types.h"
5
6#include "probfd/pdbs/types.h"
7
8#include <cstddef>
9#include <iosfwd>
10#include <memory>
11#include <stack>
12#include <vector>
13
14// Forward Declarations
15struct FactPair;
16
17namespace probfd {
18template <typename>
19struct Transition;
20}
21
22namespace probfd::pdbs {
23class AssignmentEnumerator;
24class ProjectionOperator;
25class ProjectionStateSpace;
26} // namespace probfd::pdbs
27
28namespace probfd::pdbs {
29
33class MatchTree {
34 struct Node;
35
36 std::unique_ptr<Node> root_;
37 std::vector<ProjectionOperator> projection_operators_;
38 mutable std::stack<Node*> nodes_; // reuse storage
39
40public:
41 explicit MatchTree(size_t hint_num_operators = 0);
42
43 ~MatchTree();
44
49 void insert(
50 const AssignmentEnumerator& ranking_function,
52 const std::vector<FactPair>& progression_preconditions,
53 FDRSimpleCostFunction* task_cost_function);
54
60 StateRank abstract_state,
61 std::vector<const ProjectionOperator*>& operators) const;
62
68 StateRank abstract_state,
69 std::vector<Transition<const ProjectionOperator*>>& transitions,
70 ProjectionStateSpace& state_space) const;
71
75 void dump(std::ostream& out) const;
76
77private:
78 void dump_recursive(std::ostream& out, Node* node) const;
79};
80
81} // namespace probfd::pdbs
82
83#endif
Applicable actions generator for projections.
Definition match_tree.h:33
void generate_all_transitions(StateRank abstract_state, std::vector< Transition< const ProjectionOperator * > > &transitions, ProjectionStateSpace &state_space) const
Obtain the applicable prohjection operators for a given abstract state.
void dump(std::ostream &out) const
Dump the match tree to an output stream.
void insert(const AssignmentEnumerator &ranking_function, ProjectionOperator op, const std::vector< FactPair > &progression_preconditions, FDRSimpleCostFunction *task_cost_function)
Insert a new projection operator with the given preconditions into the match tree.
void get_applicable_operators(StateRank abstract_state, std::vector< const ProjectionOperator * > &operators) const
Obtain the applicable prohjection operators for a given abstract state.
Represents an operator of a projection state space.
Definition projection_operator.h:18
Represents the state space of a projection of a probabilistic planning task.
Definition projection_state_space.h:29
Namespace dedicated to probabilistic pattern databases.
Definition gzocp_heuristic.h:16
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
SimpleCostFunction< State, OperatorID > FDRSimpleCostFunction
Type alias for simple cost functions for MDPs in FDR.
Definition fdr_types.h:39