AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
|
#include "probfd/pdbs/probability_aware_pattern_database.h"
Implementation of a probability-aware pattern database.
This class bundles two objects:
A PDB does not store information about the projection state space for which it was constructed. The state space should be pre-computed and stored seperately if it is needed.
Public Member Functions | |
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 (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. | |
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 database, used as a heuristic. | |
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 determinization-based pattern database, used as a heuristic. | |
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-aware pattern by one variable. | |
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 pattern database with one additional variable. | |
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 probability-aware PDBs. | |
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 patterns of two probability-aware PDBs. | |
const Pattern & | get_pattern () const |
Get the pattern of the pattern database. | |
const StateRankingFunction & | get_state_ranking_function () const |
Get the abstraction mapping of the pattern database. | |
const std::vector< value_t > & | get_value_table () const |
Get the abstraction mapping of the pattern database. | |
unsigned int | num_states () const |
Get the number of states in this PDB's projection. | |
StateRank | get_abstract_state (const State &state) const |
Compute the state rank of the abstract state of an input state. | |
value_t | lookup_estimate (const State &s) const |
Get the optimal state value of the abstract state corresponding to the input state. | |
value_t | lookup_estimate (StateRank s) const |
Look up the estimate of an abstract state specified by state rank in the lookup table. | |
probfd::pdbs::ProbabilityAwarePatternDatabase::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.
task_proxy | The input task. |
pattern | The pattern inducing the projection. |
initial_state | The initial state. States unreachable from the initial state are treated as dead ends. |
operator_pruning | Specifies whether operators with the same precondition, cost, effect and effect probabilities shall be pruned during construction of the projection. |
heuristic | An admissible heuristic for the projection, used to accelerate the computation of the lookup table. |
max_time | The time limit for construction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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.
projection | The projection state space. |
ranking_function | The state ranking function for the projection. |
initial_state | The abstract initial state of the projection. States unreachable from the initial state are treated as dead ends. |
heuristic | An admissible heuristic for the projection, used to accelerate the computation of the lookup table. |
max_time | The time limit for construction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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 database, used as a heuristic.
task_proxy | The input task. |
task_cost_function | The task's cost function. |
pdb | The determinization-based pattern database. This PDB must be constructed for the same pattern. |
initial_state | The initial state. States unreachable from the initial state are treated as dead ends. |
operator_pruning | Specifies whether operators with the same precondition, cost, effect and effect probabilities shall be pruned during construction of the projection. |
max_time | The time limit for construction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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 determinization-based pattern database, used as a heuristic.
projection | The projection state space. |
ranking_function | The state ranking function for the projection. |
initial_state | The abstract initial state of the projection. States unreachable from the initial state are treated as dead ends. |
pdb | The determinization-based pattern database. This PDB must be constructed for the same pattern. |
max_time | The time limit for construction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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-aware pattern by one variable.
This constructor makes use of the probability-aware PDB which it extends by using it as a heuristic to accelerate the lookup computation.
task_proxy | The input task with respect to which the projection is constructed. |
task_cost_function | The task's cost function. |
pdb | A previous probability-aware pattern database. |
add_var | A task variable with with the previous PDB shall be extended. |
initial_state | The initial state for the exhaustive solver. States unreachable from this state are treated as dead ends. |
operator_pruning | Whether equivalent operators shall be pruned during construction of the projection. |
max_time | The time limit for contruction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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 pattern database with one additional variable.
This constructor makes use of the supplied PDB by using its induced heuristic to accelerate the value table computation.
state_space | The preconstructed state space of the projection. |
ranking_function | The preconstructed ranking function for the PDB. |
initial_state | The rank of the initial state for the exhaustive solver. States unreachable from this state are treated as dead ends. |
pdb | A previous probability-aware pattern database. |
add_var | A task variable with with the previous PDB shall be extended. |
max_time | The time limit for contruction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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 probability-aware PDBs.
This constructor makes use of the supplied PDBs by using the maximum over their heuristics to accelerate the value table computation.
task_proxy | The input task with respect to which the projection is constructed. |
task_cost_function | The task's cost function. |
left | A previous probability-aware pattern database for the given task. |
right | A previous probability-aware pattern database for the given task. |
initial_state | The initial state for the exhaustive solver. States unreachable from this state are treated as dead ends. |
operator_pruning | Whether equivalent operators shall be pruned during construction of the projection. |
max_time | The time limit for contruction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
probfd::pdbs::ProbabilityAwarePatternDatabase::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 patterns of two probability-aware PDBs.
This constructor makes use of the supplied PDBs by using the maximum over their heuristics to accelerate the value table computation.
state_space | The preconstructed state space of the projection. |
ranking_function | The preconstructed ranking function for the PDB. |
initial_state | The rank of the initial state for the exhaustive solver. States unreachable from this state are treated as dead ends. |
left | A previous pattern database for the given task. |
right | A previous pattern database for the given task. |
max_time | The time limit for contruction. If exceeded, a utils::TimeoutException will be thrown. |
utils::TimeoutException | if the given max_time is exceeded. |
|
nodiscard |
Get the pattern of the pattern database.
|
nodiscard |
Get the abstraction mapping of the pattern database.
|
nodiscard |
Get the abstraction mapping of the pattern database.
|
nodiscard |
Get the number of states in this PDB's projection.
|
nodiscard |
Compute the state rank of the abstract state of an input state.
|
nodiscard |
Get the optimal state value of the abstract state corresponding to the input state.
|
nodiscard |
Look up the estimate of an abstract state specified by state rank in the lookup table.