intrinsic.solutions.behavior_tree.Node
![]() View source on GitHub |
Parent abstract base class for all the supported behavior tree nodes.
Attributes | |
|---|---|
The proto representation of the node. | |
Optional name of the node. | |
A string label of the node type. | |
A list of decorators for the current node. | |
Optional type of breakpoint configured for this node. | |
Optional execution mode for this node. | |
A unique id for this node. | |
Methods
create_from_proto
View source
@classmethodcreate_from_proto( proto_object: behavior_tree_pb2.BehaviorTree.Node ) -> 'Node'
Instantiates a Node instance from a proto.
disable_execution
View source
disable_execution(
result_state: Optional[intrinsic.solutions.behavior_tree.DisabledResultState] = None
) -> 'Node'
Disables a node, so that it is not executed and appears to be skipped.
| Args | |
|---|---|
| Optionally force the result of the execution to this state. If not set, the resulting state is automatically determined, so that the node is skipped. |
| Returns | |
|---|---|
Builder pattern, returns self. |
dot_graph
View source
@abc.abstractmethoddot_graph( node_id_suffix: str = '', node_label: Optional[str] = None, name: Optional[str] = None ) -> Tuple[graphviz.Digraph, str]
Generates a graphviz subgraph with a single node for self.
| Args | |
|---|---|
| A little string of form |
| The label is typically just the type of the node. To use a different value, this argument can be used. |
| name of the node as set by the user. |
| Returns | |
|---|---|
A tuple of the generated graphviz dot graph and the name of the graph's root node. |
enable_execution
View source
enable_execution() -> 'Node'
Enables a node, so that it will be executed.
| Returns | |
|---|---|
Builder pattern, returns self. |
generate_and_set_unique_id
View source
generate_and_set_unique_id() -> int
Generates a new random id and sets it for this node.
set_breakpoint
View source
set_breakpoint(
breakpoint_type: Optional['BreakpointType']
) -> 'Node'
Sets the breakpoint type on the decorator.
| Args | |
|---|---|
| desired breakpoint type, None to remove type. |
| Returns | |
|---|---|
Builder pattern, returns self. |
set_decorators
View source
@abc.abstractmethodset_decorators( decorators: Optional['Decorators'] ) -> 'Node'
show
View source
show() -> None
visit
View source
visit(
containing_tree: 'BehaviorTree',
callback: Callable[['BehaviorTree', Union['BehaviorTree', 'Node', 'Condition']], None]
) -> None