concepts.dm.pdsketch.planners.discrete_search.heuristic_search_strips#

heuristic_search_strips(executor, state, goal_expr, strips_heuristic='hff', *, max_expansions=100000, max_depth=100, heuristic_weight=float('inf'), external_heuristic_function=None, actions=None, continuous_values=None, action_filter=None, strips_forward_relevance_analysis=False, strips_backward_relevance_analysis=True, strips_use_sas=False, use_strips_op=False, use_tuple_desc=True, forward_state_variables=True, forward_derived=False, track_most_promising_trajectory=False, prob_goal_threshold=0.5, verbose=False, return_extra_info=False)[source]#

Perform heuristic search with STRIPS-based heuristics.

Parameters:
  • executor (PDSketchExecutor) – the executor.

  • state (State) – the initial state.

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

  • strips_heuristic (str) – the heuristic to use. Should be a string. Use ‘external’ to use the external heuristic function.

  • max_expansions (int) – the maximum number of expanded nodes.

  • max_depth (int) – the maximum depth of the search.

  • heuristic_weight (float) – the weight of the heuristic. Use float(‘inf’) to do greedy best-first search.

  • external_heuristic_function (Callable[[State, ValueOutputExpression], int]) – the external heuristic function. Should be a function that takes in a state and a goal expression, and returns an integer.

  • actions (Sequence[OperatorApplier] | None) – the actions to use. If None, use all possible actions.

  • continuous_values (Dict[str, List[TensorValue]] | None) – the continuous values for action parameters. If None, all action parameters should be discrete.

  • action_filter (Callable[[OperatorApplier], bool]) – the action filter. If None, use all possible actions. It should be a function that takes in an action and returns a boolean.

  • strips_forward_relevance_analysis (bool) – whether to perform forward relevance analysis when translating the problem into STRIPS.

  • strips_backward_relevance_analysis (bool) – whether to perform backward relevance analysis when translating the problem into STRIPS.

  • strips_use_sas (bool) – whether to use SAS Strips compiler (AODiscretization).

  • use_strips_op (bool) – whether to use STRIPS operators when applying actions. Recommended to be False.

  • use_tuple_desc (bool) – whether to use tuple description to prune the search space.

  • forward_state_variables (bool) – whether to forward state variables before the search starts.

  • forward_derived (bool) – whether to forward derived predicates after applying actions.

  • track_most_promising_trajectory (bool) – whether to track the most promising trajectory.

  • prob_goal_threshold (float) – the probability threshold for the most promising trajectory. When there is a trajectory with probability greater than this threshold, the search will stop.

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

  • return_extra_info (bool) – whether to return extra information, such as the number of expanded nodes.

Returns:

the trajectory if succeeded, otherwise None. When return_extra_info is True, return a tuple of (trajectory, extra_info), where extra_info is a dictionary.

Return type:

Sequence[OperatorApplier] | None | Tuple[Sequence[OperatorApplier] | None, Dict[str, Any]]