concepts.dm.crow.planners.regression_planning_impl.crow_regression_planner_astar_v3.CrowRegressionPlannerAStarv3#

class CrowRegressionPlannerAStarv3[source]#

Bases: CrowRegressionPlanner

Methods

bfs(planning_state)

bfs_add_queue(planning_state)

bfs_expand(planning_state)

The BFS algorithm is simulating a hierarchical planning algorithm.

evaluate(expression, state[, csp, ...])

main()

main_entry(program)

Attributes

queue

__init__(executor, state, goal_expr, *, simulation_interface=None, enable_reordering=True, max_search_depth=20, 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, verbose=True)#
Parameters:
__new__(**kwargs)#
bfs(planning_state)[source]#
Parameters:

planning_state (CrowPlanningState2) –

Return type:

Sequence[CrowPlanningResult]

bfs_add_queue(planning_state)[source]#
Parameters:

planning_state (CrowPlanningState2) –

bfs_expand(planning_state)[source]#

The BFS algorithm is simulating a hierarchical planning algorithm. The current state can be encoded as:

left_actions = (a1, a2, a3, ...)
middle_program = CrowActionOrderingSuite(...)
right_statements = [RegressionStatement2(...), RegressionStatement2(...), ...]

It corresponds to this figure:

a1 -> a2 -> a3 -> ... -> {middle_program} -> [right_statements]

Therefore,

  • state.left_actions: the actions that have been executed (a1, a2, a3, …).

  • state.program: the current program that is being expanded ({middle_program}).

  • state.right_statements: the statements that are waiting to be expanded ([right_statements]).

At each step,

  • If the program is empty, we will pop up the first right statement and expand it.

  • If the program is not empty, we will randomly pop a statement from the middle program, and prepend it to the right statements.

Parameters:

planning_state (CrowPlanningState2) –

evaluate(expression, state, csp=None, bounded_variables=None, clone_csp=True)#
Parameters:
Return type:

Tuple[None | StateObjectReference | StateObjectList | TensorValue | OptimisticValue, ConstraintSatisfactionProblem | None]

main()#
Return type:

Tuple[List[Tuple[CrowControllerApplier, …]], dict]

main_entry(program)[source]#
Parameters:

program (CrowActionOrderingSuite) –

Return type:

List[Tuple[CrowControllerApplier, …]]

queue: PriorityQueue#