AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
probability_aware_pattern_database.h
1#ifndef PROBFD_PDBS_PROBABILITY_AWARE_PATTERN_DATABASE_H
2#define PROBFD_PDBS_PROBABILITY_AWARE_PATTERN_DATABASE_H
3
4#include "probfd/pdbs/evaluators.h"
5#include "probfd/pdbs/state_ranking_function.h"
6#include "probfd/pdbs/types.h"
7
8#include "probfd/heuristics/constant_evaluator.h"
9
10#include "probfd/fdr_types.h"
11
12#include <limits>
13#include <vector>
14
15namespace probfd {
16class ProbabilisticTaskProxy;
17}
18
19namespace probfd::pdbs {
20class ProjectionStateSpace;
21}
22
23namespace probfd::pdbs {
24
38 StateRankingFunction ranking_function_;
39 std::vector<value_t> value_table_;
40
42 ProbabilisticTaskProxy task_proxy,
43 Pattern pattern);
44
46 StateRankingFunction ranking_function);
47
48public:
50 StateRankingFunction ranking_function,
51 std::vector<value_t> value_table);
52
72 ProbabilisticTaskProxy task_proxy,
73 std::shared_ptr<FDRSimpleCostFunction> task_cost_function,
74 Pattern pattern,
75 const State& initial_state,
76 bool operator_pruning = true,
77 const StateRankEvaluator& heuristic =
79 double max_time = std::numeric_limits<double>::infinity());
80
97 ProjectionStateSpace& projection,
98 StateRankingFunction ranking_function,
99 StateRank initial_state,
100 const StateRankEvaluator& heuristic =
102 double max_time = std::numeric_limits<double>::infinity());
103
123 ProbabilisticTaskProxy task_proxy,
124 std::shared_ptr<FDRSimpleCostFunction> task_cost_function,
125 const ::pdbs::PatternDatabase& pdb,
126 const State& initial_state,
127 bool operator_pruning = true,
128 double max_time = std::numeric_limits<double>::infinity());
129
147 ProjectionStateSpace& projection,
148 StateRankingFunction ranking_function,
149 const ::pdbs::PatternDatabase& pdb,
150 StateRank initial_state,
151 double max_time = std::numeric_limits<double>::infinity());
152
176 ProbabilisticTaskProxy task_proxy,
177 std::shared_ptr<FDRSimpleCostFunction> task_cost_function,
179 int add_var,
180 const State& initial_state,
181 bool operator_pruning = true,
182 double max_time = std::numeric_limits<double>::infinity());
183
205 ProjectionStateSpace& state_space,
206 StateRankingFunction ranking_function,
208 int add_var,
209 StateRank initial_state,
210 double max_time = std::numeric_limits<double>::infinity());
211
237 ProbabilisticTaskProxy task_proxy,
238 std::shared_ptr<FDRSimpleCostFunction> task_cost_function,
241 const State& initial_state,
242 bool operator_pruning = true,
243 double max_time = std::numeric_limits<double>::infinity());
244
265 ProjectionStateSpace& state_space,
266 StateRankingFunction ranking_function,
269 StateRank initial_state,
270 double max_time = std::numeric_limits<double>::infinity());
271
273 [[nodiscard]]
274 const Pattern& get_pattern() const;
275
277 [[nodiscard]]
279
281 [[nodiscard]]
282 const std::vector<value_t>& get_value_table() const;
283
285 [[nodiscard]]
286 unsigned int num_states() const;
287
289 [[nodiscard]]
290 StateRank get_abstract_state(const State& state) const;
291
294 [[nodiscard]]
295 value_t lookup_estimate(const State& s) const;
296
299 [[nodiscard]]
300 value_t lookup_estimate(StateRank s) const;
301};
302
303} // namespace probfd::pdbs
304
305#endif // PROBFD_PDBS_PROBABILITY_AWARE_PATTERN_DATABASE_H
The interface representing heuristic functions.
Definition mdp_algorithm.h:16
Proxy class used to inspect a probabilistic planning task.
Definition task_proxy.h:194
Returns an estimate of zero for each state.
Definition constant_evaluator.h:38
Implementation of a probability-aware pattern database.
Definition probability_aware_pattern_database.h:37
unsigned int num_states() const
Get the number of states in this PDB's projection.
ProbabilityAwarePatternDatabase(ProjectionStateSpace &state_space, StateRankingFunction ranking_function, const ProbabilityAwarePatternDatabase &pdb, int add_var, StateRank initial_state, double max_time=std::numeric_limits< double >::infinity())
Construct a pattern database for the given projection state space and the pattern of a previous patte...
const Pattern & get_pattern() const
Get the pattern of the pattern database.
ProbabilityAwarePatternDatabase(ProjectionStateSpace &state_space, StateRankingFunction ranking_function, const ProbabilityAwarePatternDatabase &left, const ProbabilityAwarePatternDatabase &right, StateRank initial_state, double max_time=std::numeric_limits< double >::infinity())
Construct a probability-aware pattern database the given projection state space and the union of the ...
ProbabilityAwarePatternDatabase(ProbabilisticTaskProxy task_proxy, std::shared_ptr< FDRSimpleCostFunction > task_cost_function, const ProbabilityAwarePatternDatabase &left, const ProbabilityAwarePatternDatabase &right, const State &initial_state, bool operator_pruning=true, double max_time=std::numeric_limits< double >::infinity())
Construct a probability-aware pattern database for a given task and the union of the patterns of two ...
ProbabilityAwarePatternDatabase(ProjectionStateSpace &projection, StateRankingFunction ranking_function, StateRank initial_state, const StateRankEvaluator &heuristic=heuristics::BlindEvaluator< StateRank >(), double max_time=std::numeric_limits< double >::infinity())
Construct the probability-aware pattern database for the given projection state space.
value_t lookup_estimate(StateRank s) const
Look up the estimate of an abstract state specified by state rank in the lookup table.
const StateRankingFunction & get_state_ranking_function() const
Get the abstraction mapping of the pattern database.
value_t lookup_estimate(const State &s) const
Get the optimal state value of the abstract state corresponding to the input state.
ProbabilityAwarePatternDatabase(ProbabilisticTaskProxy task_proxy, std::shared_ptr< FDRSimpleCostFunction > task_cost_function, Pattern pattern, const State &initial_state, bool operator_pruning=true, const StateRankEvaluator &heuristic=heuristics::BlindEvaluator< StateRank >(), double max_time=std::numeric_limits< double >::infinity())
Construct a probability-aware pattern database for a given task and pattern.
ProbabilityAwarePatternDatabase(ProbabilisticTaskProxy task_proxy, std::shared_ptr< FDRSimpleCostFunction > task_cost_function, const ProbabilityAwarePatternDatabase &pdb, int add_var, const State &initial_state, bool operator_pruning=true, double max_time=std::numeric_limits< double >::infinity())
Construct a probability-aware pattern database for a given task, by extending a previous probability-...
ProbabilityAwarePatternDatabase(ProbabilisticTaskProxy task_proxy, std::shared_ptr< FDRSimpleCostFunction > task_cost_function, const ::pdbs::PatternDatabase &pdb, const State &initial_state, bool operator_pruning=true, double max_time=std::numeric_limits< double >::infinity())
Construct a probability-aware pattern database for a given task from a determinization-based pattern ...
const std::vector< value_t > & get_value_table() const
Get the abstraction mapping of the pattern database.
StateRank get_abstract_state(const State &state) const
Compute the state rank of the abstract state of an input state.
ProbabilityAwarePatternDatabase(ProjectionStateSpace &projection, StateRankingFunction ranking_function, const ::pdbs::PatternDatabase &pdb, StateRank initial_state, double max_time=std::numeric_limits< double >::infinity())
Construct the probability-aware pattern database for the given projection state space from a determin...
Represents the state space of a projection of a probabilistic planning task.
Definition projection_state_space.h:29
Implements the state ranking function for abstract states of projections.
Definition state_ranking_function.h:24
Namespace dedicated to probabilistic pattern databases.
Definition gzocp_heuristic.h:16
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
double value_t
Typedef for the state value type.
Definition aliases.h:7