concepts.dm.crow.behavior.CrowBehavior#

class CrowBehavior[source]#

Bases: object

A behavior definition in the CROW planner has the following components:

  • name: the name of the behavior.

  • arguments: the arguments of the behavior.

  • goal: the goal of the behavior.

  • body: the body of the behavior.

  • preconditions: the preconditions of the behavior. This is equivalent to having an “assert” statement at the beginning of the body.

  • effects: the effects of the behavior. This section will update the state of the world.

  • heuristic: the heuristic of the behavior. This is used to guide the search process.

  • minimize: the expression to minimize. This is used to guide the search process.

Methods

assign_body_program_scope(scope_id)

Assign the program scope to the body.

is_sequential_only()

Check if the behavior body contains only sequential statements (i.e., no preamble and promotable).

long_str()

short_str()

Attributes

argument_names

The names of the arguments.

argument_types

The types of the arguments.

name

The name of the behavior.

arguments

The arguments of the behavior.

goal

The goal of the behavior.

body

The body of the behavior.

effect_body

The effects of the behavior.

heuristic

The heuristic of the behavior.

minimize

The expression to minimize.

always

Whether the behavior is always feasible.

__init__(name, arguments, goal, body, effect_body=None, heuristic=None, minimize=None, always=True)[source]#

Initialize a new behavior.

Parameters:
__new__(**kwargs)#
assign_body_program_scope(scope_id)[source]#

Assign the program scope to the body.

Parameters:

scope_id (int)

Return type:

CrowBehaviorOrderingSuite

is_sequential_only()[source]#

Check if the behavior body contains only sequential statements (i.e., no preamble and promotable).

Return type:

bool

long_str()[source]#
short_str()[source]#
always: bool#

Whether the behavior is always feasible.

property argument_names: Tuple[str, ...]#

The names of the arguments.

property argument_types: Tuple[ObjectType | ValueType, ...]#

The types of the arguments.

arguments: Tuple[Variable, ...]#

The arguments of the behavior.

body: CrowBehaviorOrderingSuite#

The body of the behavior.

effect_body: CrowBehaviorOrderingSuite#

The effects of the behavior.

goal: ValueOutputExpression#

The goal of the behavior.

heuristic: CrowBehaviorOrderingSuite | None#

The heuristic of the behavior.

minimize: ValueOutputExpression | None#

The expression to minimize.

name: str#

The name of the behavior.