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.
Check if the behavior body contains only sequential statements (i.e., no preamble and promotable).
long_str
()Attributes
The names of the arguments.
The types of the arguments.
The name of the behavior.
The arguments of the behavior.
The goal of the behavior.
The body of the behavior.
The preconditions of the behavior.
The effects of the behavior.
Whether the behavior is always feasible.
- __init__(name, arguments, goal, body, preconditions=tuple(), effect_body=None, always=True)[source]#
Initialize a new behavior.
- Parameters:
name (str) – the name of the behavior.
arguments (Sequence[Variable]) – the arguments of the behavior.
goal (ValueOutputExpression | None) – the goal of the behavior.
body (CrowBehaviorOrderingSuite) – the body of the behavior.
preconditions (Sequence[CrowPrecondition]) – the preconditions of the behavior.
effect_body (CrowBehaviorOrderingSuite | None) – the body of the effects.
always (bool)
- __new__(**kwargs)#
- assign_body_program_scope(scope_id)[source]#
Assign the program scope to the body.
- Parameters:
scope_id (int)
- Return type:
- is_sequential_only()[source]#
Check if the behavior body contains only sequential statements (i.e., no preamble and promotable).
- Return type:
- property argument_types: Tuple[ObjectType | ValueType, ...]#
The types of the arguments.
- body: CrowBehaviorOrderingSuite#
The body of the behavior.
- effect_body: CrowBehaviorOrderingSuite#
The effects of the behavior.
- goal: ValueOutputExpression#
The goal of the behavior.
- preconditions: Tuple[CrowPrecondition, ...]#
The preconditions of the behavior.