yasmin_editor.model.state module

Base state model.

class yasmin_editor.model.state.State(name: str, description: str = '', keys: list[~yasmin_editor.model.key.Key] = <factory>, outcomes: list[~yasmin_editor.model.outcome.Outcome] = <factory>, parameters: list[~yasmin_editor.model.parameter.Parameter] = <factory>, remappings: dict[str, str] = <factory>, parameter_mappings: dict[str, str] = <factory>, state_type: str | None = None, module: str | None = None, class_name: str | None = None, package_name: str | None = None, file_name: str | None = None)

Bases: object

Base model for all YASMIN states.

add_key(key: Key) None

Add a blackboard key to the state.

add_outcome(outcome: Outcome) None

Add an outcome to the state.

add_parameter(parameter: Parameter) None

Add a declared parameter to the state.

class_name: str | None
description: str
file_name: str | None
get_outcome(name: str) Outcome | None

Return an outcome by name.

property is_container: bool

Return whether this state contains child states.

property is_leaf: bool

Return whether this state is a leaf state.

keys: list[Key]
module: str | None
name: str
outcomes: list[Outcome]
package_name: str | None
parameter_mappings: dict[str, str]
parameters: list[Parameter]
remappings: dict[str, str]
rename_outcome(old_name: str, new_name: str) None

Rename one outcome of this state.

state_type: str | None
to_string(indent: int = 0) str

Return a human-readable representation of the state.