concepts.dm.pdsketch.planners.discrete_search.brute_force_search#
- brute_force_search(executor, state, goal_expr, *, max_depth=5, actions=None, continuous_values=None, action_filter=None, use_tuple_desc=True, use_only_macro_operators=False, allow_macro_operators=False, forward_state_variables=True, forward_derived=True, verbose=False, return_extra_info=False)[source]#
Brute-force search for a plan that satisfies the goal expression.
- Parameters:
executor (PDSketchExecutor) – the executor.
state (State) – the initial state.
goal_expr (str | ValueOutputExpression) – the goal expression.
max_depth (int) – the maximum depth of the search.
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.
use_tuple_desc (bool) – whether to use tuple description to prune the search space.
use_only_macro_operators (bool) – whether to use only macro operators.
allow_macro_operators (bool) – whether to allow macro operators.
forward_state_variables (bool) – whether to forward state variables before the search starts.
forward_derived (bool) – whether to forward derived predicates after applying actions.
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]]