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.

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.

preconditions

The preconditions of the behavior.

effect_body

The effects of the behavior.

always

Whether the behavior is always feasible.

__init__(name, arguments, goal, body, preconditions=tuple(), effect_body=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.

name: str#

The name of the behavior.

preconditions: Tuple[CrowPrecondition, ...]#

The preconditions of the behavior.