concepts.dm.crow.behavior.CrowBehaviorOrderingSuite#

class CrowBehaviorOrderingSuite[source]#

Bases: CrowBehaviorBodySuiteBase

Methods

clone(variable_scope_identifier)

get_flatten_body()

Get the flatten body of the behavior.

is_empty()

is_single_statement()

iter_statements()

iter_statements_with_scope()

make_promotable(*statements[, ...])

make_sequential(*statements[, ...])

make_unordered(*statements[, ...])

pop_right_statement()

split_preamble_and_promotable()

Split the body into three parts: the preamble part, the promotable part, and the rest part.

split_promotable()

Split the body into two parts: the promotable part and the rest part.

unwrap_alternative()

unwrap_critical()

Attributes

statements

The statements in a behavior body suite.

order

The ordering of the behavior body suite.

variable_scope_identifier

The identifier of the variable scope.

ORDER#

alias of CrowBehaviorStatementOrdering

__init__(order, statements, variable_scope_identifier=None, _skip_simplify=False)[source]#
Parameters:
__new__(**kwargs)#
clone(variable_scope_identifier)[source]#
Parameters:

variable_scope_identifier (int)

get_flatten_body()[source]#

Get the flatten body of the behavior. It only flattens the PROMOTABLE body. Note that this function does NOT recursively flatten the body. Instead, it returns a list of items that is the concatenation of the preamble section (left), the promotable section (middle) and the rest of the body (right).

Returns:

the flatten body.

Return type:

Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …]

is_empty()[source]#
Return type:

bool

is_single_statement()[source]#
Return type:

bool

iter_statements()[source]#
iter_statements_with_scope()[source]#
classmethod make_promotable(*statements, variable_scope_identifier=None, _skip_simplify=False)[source]#
Parameters:
classmethod make_sequential(*statements, variable_scope_identifier=None, _skip_simplify=False)[source]#
Parameters:
classmethod make_unordered(*statements, variable_scope_identifier=None, _skip_simplify=False)[source]#
Parameters:
pop_right_statement()[source]#
Return type:

Iterator[Tuple[CrowBehaviorOrderingSuite | None, CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, int]]

split_preamble_and_promotable()[source]#

Split the body into three parts: the preamble part, the promotable part, and the rest part.

Return type:

Tuple[Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …] | None, Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …] | None, Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …]]

split_promotable()[source]#

Split the body into two parts: the promotable part and the rest part.

Return type:

Tuple[Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …] | None, Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, …]]

unwrap_alternative()[source]#
Return type:

Iterator[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression]

unwrap_critical()[source]#
order: CrowBehaviorStatementOrdering#

The ordering of the behavior body suite.

property statements: Tuple[CrowBehaviorCommit | CrowAchieveExpression | CrowUntrackExpression | CrowAssertExpression | CrowBindExpression | CrowControllerApplicationExpression | CrowRuntimeAssignmentExpression | CrowFeatureAssignmentExpression | CrowBehaviorConditionSuite | CrowBehaviorWhileLoopSuite | CrowBehaviorForeachLoopSuite | CrowBehaviorOrderingSuite | CrowBehaviorApplicationExpression, ...]#

The statements in a behavior body suite.

variable_scope_identifier: int | None#

The identifier of the variable scope. This is only used during search.