concepts.dm.pdsketch.planners.optimistic_search.optimistic_search#
- optimistic_search(executor, state, goal_expr, *, max_depth=5, csp_max_generator_trials=3, actions=None, action_filter=None, use_tuple_desc=False, use_csp_pruning=True, forward_state_variables=True, forward_derived=False, verbose=False, return_extra_info=False)[source]#
Perform brute-force search with DPLL+Sampling algorithm for mixed discrete-continuous domains.
- 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.
csp_max_generator_trials (int) – the maximum number of trials for calling CSP generators.
actions (Sequence[OperatorApplier] | None) – the actions to use. If None, use all possible actions. Partially grounded actions are allowed.
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_csp_pruning (bool) – whether to use partial CSP solver 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.
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]]