Differences between revisions 6 and 7
Revision 6 as of 2019-11-22 20:01:09
Size: 470
Editor: XmlRpcBot
Comment:
Revision 7 as of 2021-07-01 08:47:48
Size: 7323
Editor: XmlRpcBot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
== CEGAR ==

This pattern generator uses the CEGAR algorithm restricted to a random single goal of the task to compute a pattern. Also see the paper

 * Alexander Rovner, Silvan Sievers and Malte Helmert.<<BR>>
 [[https://ai.dmi.unibas.ch/papers/rovner-et-al-icaps2019.pdf|Counterexample-Guided Abstraction Refinement for Pattern Selection in Optimal Classical Planning]].<<BR>>
 In ''Proceedings of the 29th International Conference on Automated Planning and Scheduling (ICAPS 2019)'', pp. 362-367. AAAI Press, 2019.

{{{
cegar_pattern(max_pdb_size=1000000, max_time=infinity, use_wildcard_plans=true, verbosity=normal, random_seed=-1)
}}}

 * ''max_pdb_size'' (int [1, infinity]): maximum number of states in the final pattern database (possibly ignored by a singleton pattern consisting of a single goal variable)
 * ''max_time'' (double [0.0, infinity]): maximum time in seconds for the pattern generation
 * ''use_wildcard_plans'' (bool): if true, compute wildcard plans which are sequences of sets of operators that induce the same transition; otherwise compute regular plans which are sequences of single operators
 * ''verbosity'' ({silent, normal, verbose, debug}): Option to specify the verbosity level.
  * {{{silent}}}: only the most basic output
  * {{{normal}}}: relevant information to monitor progress
  * {{{verbose}}}: full output
  * {{{debug}}}: like full with additional debug output
 * ''random_seed'' (int [-1, infinity]): Set to -1 (default) to use the global random number generator. Set to any other value to use a local random number generator with the given seed.
=== Implementation notes about the CEGAR algorithm ===
The following describes differences of the implementation to the original implementation used and described in the paper.

Conceptually, there is one larger difference which concerns the computation of (regular or wildcard) plans for PDBs. The original implementation used an enforced hill-climbing (EHC) search with the PDB as the perfect heuristic, which ensured finding strongly optimal plans, i.e., optimal plans with a minimum number of zero-cost operators, in domains with zero-cost operators. The original implementation also slightly modified EHC to search for a best-improving successor, chosen uniformly at random among all best-improving successors.

In contrast, the current implementation computes a plan alongside the computation of the PDB itself. A modification to Dijkstra's algorithm for computing the PDB values stores, for each state, the operator leading to that state (in a regression search). This generating operator is updated only if the algorithm found a cheaper path to the state. After Dijkstra finishes, the plan computation starts at the initial state and iteratively follows the generating operator, computes all operators of the same cost inducing the same transition, until reaching a goal. This constitutes a wildcard plan. It is turned into a regular one by randomly picking a single operator for each transition.

Note that this kind of plan extraction does not consider all successors of a state uniformly at random but rather uses the previously deterministically chosen generating operator to settle on one successor state, which is biased by the number of operators leading to the same successor from the given state. Further note that in the presence of zero-cost operators, this procedure does not guarantee that the computed plan is strongly optimal because it does not minimize the number of used zero-cost operators leading to the state when choosing a generating operator. Experiments have shown (issue1007) that this speeds up the computation significantly while not having a strongly negative effect on heuristic quality due to potentially computing worse plans.

Two further changes fix bugs of the original implementation to match the description in the paper. The first bug fix is to raise a flaw for all goal variables of the task if the plan for a PDB can be executed on the concrete task but does not lead to a goal state. Previously, such flaws would not have been raised because all goal variables are part of the collection from the start on and therefore not considered. This means that the original implementation accidentally disallowed merging patterns due to goal violation flaws. The second bug fix is to actually randomize the order of parallel operators in wildcard plan steps.
Line 6: Line 38:
Line 10: Line 41:
Line 19: Line 51:
== Random Pattern ==
This pattern generator implements the 'single randomized causal graph' algorithm described in experiments of the the paper

 * Alexander Rovner, Silvan Sievers and Malte Helmert.<<BR>>
 [[https://ai.dmi.unibas.ch/papers/rovner-et-al-icaps2019.pdf|Counterexample-Guided Abstraction Refinement for Pattern Selection in Optimal Classical Planning]].<<BR>>
 In ''Proceedings of the 29th International Conference on Automated Planning and Scheduling (ICAPS 2019)'', pp. 362-367. AAAI Press, 2019.

It computes a pattern by performing a simple random walk on the causal graph, starting from the given random goal variable, and including all visited variables.

{{{
random_pattern(max_pdb_size=1000000, max_time=infinity, bidirectional=true, verbosity=normal, random_seed=-1)
}}}

 * ''max_pdb_size'' (int [1, infinity]): maximum number of states in the final pattern database (possibly ignored by a singleton pattern consisting of a single goal variable)
 * ''max_time'' (double [0.0, infinity]): maximum time in seconds for the pattern generation
 * ''bidirectional'' (bool): this option decides if the causal graph is considered to be directed or undirected selecting predecessors of already selected variables. If true (default), it is considered to be undirected (precondition-effect edges are bidirectional). If false, it is considered to be directed (a variable is a neighbor only if it is a predecessor.
 * ''verbosity'' ({silent, normal, verbose, debug}): Option to specify the verbosity level.
  * {{{silent}}}: only the most basic output
  * {{{normal}}}: relevant information to monitor progress
  * {{{verbose}}}: full output
  * {{{debug}}}: like full with additional debug output
 * ''random_seed'' (int [-1, infinity]): Set to -1 (default) to use the global random number generator. Set to any other value to use a local random number generator with the given seed.
'''Implementation notes about the random pattern algorithm:''' In the original implementation used in the paper, the algorithm selected a random neighbor and then checked if selecting it would violate the PDB size limit. If so, the algorithm would not select it and terminate. In the current implementation, the algorithm instead loops over all neighbors of the current variable in random order and selects the first one not violating the PDB size limit. If no such neighbor exists, the algorithm terminates.

Factory for single patterns

CEGAR

This pattern generator uses the CEGAR algorithm restricted to a random single goal of the task to compute a pattern. Also see the paper

cegar_pattern(max_pdb_size=1000000, max_time=infinity, use_wildcard_plans=true, verbosity=normal, random_seed=-1)
  • max_pdb_size (int [1, infinity]): maximum number of states in the final pattern database (possibly ignored by a singleton pattern consisting of a single goal variable)

  • max_time (double [0.0, infinity]): maximum time in seconds for the pattern generation

  • use_wildcard_plans (bool): if true, compute wildcard plans which are sequences of sets of operators that induce the same transition; otherwise compute regular plans which are sequences of single operators

  • verbosity ({silent, normal, verbose, debug}): Option to specify the verbosity level.

    • silent: only the most basic output

    • normal: relevant information to monitor progress

    • verbose: full output

    • debug: like full with additional debug output

  • random_seed (int [-1, infinity]): Set to -1 (default) to use the global random number generator. Set to any other value to use a local random number generator with the given seed.

Implementation notes about the CEGAR algorithm

The following describes differences of the implementation to the original implementation used and described in the paper.

Conceptually, there is one larger difference which concerns the computation of (regular or wildcard) plans for PDBs. The original implementation used an enforced hill-climbing (EHC) search with the PDB as the perfect heuristic, which ensured finding strongly optimal plans, i.e., optimal plans with a minimum number of zero-cost operators, in domains with zero-cost operators. The original implementation also slightly modified EHC to search for a best-improving successor, chosen uniformly at random among all best-improving successors.

In contrast, the current implementation computes a plan alongside the computation of the PDB itself. A modification to Dijkstra's algorithm for computing the PDB values stores, for each state, the operator leading to that state (in a regression search). This generating operator is updated only if the algorithm found a cheaper path to the state. After Dijkstra finishes, the plan computation starts at the initial state and iteratively follows the generating operator, computes all operators of the same cost inducing the same transition, until reaching a goal. This constitutes a wildcard plan. It is turned into a regular one by randomly picking a single operator for each transition.

Note that this kind of plan extraction does not consider all successors of a state uniformly at random but rather uses the previously deterministically chosen generating operator to settle on one successor state, which is biased by the number of operators leading to the same successor from the given state. Further note that in the presence of zero-cost operators, this procedure does not guarantee that the computed plan is strongly optimal because it does not minimize the number of used zero-cost operators leading to the state when choosing a generating operator. Experiments have shown (issue1007) that this speeds up the computation significantly while not having a strongly negative effect on heuristic quality due to potentially computing worse plans.

Two further changes fix bugs of the original implementation to match the description in the paper. The first bug fix is to raise a flaw for all goal variables of the task if the plan for a PDB can be executed on the concrete task but does not lead to a goal state. Previously, such flaws would not have been raised because all goal variables are part of the collection from the start on and therefore not considered. This means that the original implementation accidentally disallowed merging patterns due to goal violation flaws. The second bug fix is to actually randomize the order of parallel operators in wildcard plan steps.

greedy

greedy(max_states=1000000)
  • max_states (int [1, infinity]): maximal number of abstract states in the pattern database.

manual_pattern

manual_pattern(pattern)
  • pattern (list of int): list of variable numbers of the planning task that should be used as pattern.

Random Pattern

This pattern generator implements the 'single randomized causal graph' algorithm described in experiments of the the paper

It computes a pattern by performing a simple random walk on the causal graph, starting from the given random goal variable, and including all visited variables.

random_pattern(max_pdb_size=1000000, max_time=infinity, bidirectional=true, verbosity=normal, random_seed=-1)
  • max_pdb_size (int [1, infinity]): maximum number of states in the final pattern database (possibly ignored by a singleton pattern consisting of a single goal variable)

  • max_time (double [0.0, infinity]): maximum time in seconds for the pattern generation

  • bidirectional (bool): this option decides if the causal graph is considered to be directed or undirected selecting predecessors of already selected variables. If true (default), it is considered to be undirected (precondition-effect edges are bidirectional). If false, it is considered to be directed (a variable is a neighbor only if it is a predecessor.

  • verbosity ({silent, normal, verbose, debug}): Option to specify the verbosity level.

    • silent: only the most basic output

    • normal: relevant information to monitor progress

    • verbose: full output

    • debug: like full with additional debug output

  • random_seed (int [-1, infinity]): Set to -1 (default) to use the global random number generator. Set to any other value to use a local random number generator with the given seed.

Implementation notes about the random pattern algorithm: In the original implementation used in the paper, the algorithm selected a random neighbor and then checked if selecting it would violate the PDB size limit. If so, the algorithm would not select it and terminate. In the current implementation, the algorithm instead loops over all neighbors of the current variable in random order and selects the first one not violating the PDB size limit. If no such neighbor exists, the algorithm terminates.

FastDownward: Doc/PatternGenerator (last edited 2024-01-11 22:26:38 by XmlRpcBot)