class CROWRecursiveSearcherV2[source]#

Bases: object


apply_regression_rule_effect(state, rule, ...)

apply_regression_rule_prefix(node, ...)

Apply the regression rule for a prefix of the subgoal.


The main entrance of the CROW planner.


postprocess_plans(node, all_possible_plans)

solve_csp(csp, max_csp_trials[, actions])




__init__(executor, state, goal_expr, *, enable_reordering=False, max_search_depth=10, max_beam_size=20, is_goal_serialized=True, is_goal_refinement_compressible=True, enable_csp=True, max_csp_trials=10, max_global_csp_trials=100, max_csp_branching_factor=5, use_generator_manager=False, store_generator_manager_history=False, enable_simulation=False, simulator=None, enable_dirty_derived_predicates=False, enable_greedy_execution=False, allow_empty_plan_for_optimistic_goal=False, verbose=True)[source]#

Initialize the CROW planner.

  • executor (PDSketchExecutor) – the executor used to execute the expressions.

  • state (State) – the current state.

  • goal_expr (str | ValueOutputExpression) – the goal expression to achieve.

  • enable_reordering (bool) – whether to enable reordering in regression rule applications.

  • max_search_depth (int) – the maximum search depth.

  • max_beam_size (int) – the maximum beam size when trying different refinements of the same goal.

  • is_goal_serialized (bool) – whether the goal has been serialized.

  • is_goal_refinement_compressible (bool) – whether the serialized goals are refinement-compressible (i.e., for each goal item, do we need to track all the skeletons?)

  • enable_csp (bool) – whether to enable CSP solving.

  • max_csp_trials (int) – the maximum number of CSP trials.

  • max_global_csp_trials (int) – the maximum number of CSP trials for the global CSP (i.e., the CSP associated with the root node of the search tree.)

  • max_csp_branching_factor (int) – the maximum branching factor for CSP.

  • use_generator_manager (bool) – whether to use the generator manager.

  • store_generator_manager_history (bool) – whether to store the history of the generator calls in the generator manager.

  • enable_simulation (bool) – whether to enable simulation in CSP solving.

  • simulator (PDSketchSimulatorInterface | None) – the simulator used for simulation.

  • enable_dirty_derived_predicates (bool) – whether to enable dirty derived predicates.

  • enable_greedy_execution (bool) – whether to enable greedy execution.

  • allow_empty_plan_for_optimistic_goal (bool) – whether to allow empty plan for optimistic goal.

  • verbose (bool) – whether to print verbose information.

apply_regression_rule_effect(state, rule, bounded_variables)[source]#
apply_regression_rule_prefix(node, grounded_subgoals, placeholder_csp, prefix_length, bounded_variables)[source]#

Apply the regression rule for a prefix of the subgoal.

Return type:

List[Tuple[List[ValueOutputExpression], List[bool], ConstraintSatisfactionProblem | None, Dict[int, Any], Dict[str, Any]]]


The main entrance of the CROW planner.


node (CROWSearchNode) –

Return type:


Return type:

Tuple[list, dict]

postprocess_plans(node, all_possible_plans)[source]#
solve_csp(csp, max_csp_trials, actions=None)[source]#
property generator_manager: GeneratorManager | None#
property search_stat: Dict[str, Any]#