BitQuirky.Behavior.Nodes.Composite
Public behavior trees and state machines: runtime symbols in BitQuirky.Behavior.Nodes.Composite.
Source snapshot ad0983d00d77.
On this page
Assembly: BitQuirky.Behavior.Runtime
Parallel
Section titled “Parallel”Category: Node contracts
class BitQuirky.Behavior.Nodes.Composite.ParallelSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:63-164
Behavior-tree Parallel composite. Ticks every child once per tick (subject to the policy short-circuit). Returns Runningwhile any child is still running; returnsSuccess/ Failureper the configured ParallelPolicy.
Responsibilities:
- Encode the parallel aggregation rule for the runtime tick job and bake-time validation.
- Provide the baked / token identity for cross-layer correspondence.
Does NOT:
- Manage child threading: children tick on the same job thread the composite ticks on; “parallel” is logical (BT semantics), not OS-level concurrency.
Members
Section titled “Members”public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = ParallelSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:70
Baked node kind a parallel bakes to.
NodeKindToken
Section titled “NodeKindToken”public const string NodeKindToken = "parallel"Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:66-67
Kind token a parallel carries in authored graph source.
Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)
Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:127-163
Folds one child’s status into the composite’s status for hosts that walk children one at
a time instead of collecting a whole tick’s counts. A succeeding child advances to the
next sibling and reports Running until the last child succeeds; a running child is
re-ticked; any terminal status ends the composite and is passed through unchanged, and
an unrecognized status ends it as Failure.nextChildIndexis the
child index to tick next, or -1 when the composite finished this tick.
Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, ParallelPolicy policy)
Section titled “Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, ParallelPolicy policy)”public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(int successCount, int failureCount, int runningCount, int totalChildren, BitQuirky.Behavior.Nodes.Composite.ParallelPolicy policy)Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:80-117
Aggregate the per-tick child status set into a composite status.
Parameters
successCount: Children that returned Success this tick.failureCount: Children that returned Failure / Blocked this tick.runningCount: Children that returned Running this tick.totalChildren: Total number of children.policy: Termination policy.
ParallelPolicy
Section titled “ParallelPolicy”Category: Node contracts
enum BitQuirky.Behavior.Nodes.Composite.ParallelPolicySource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:29-42
Underlying type: byte
Parallel termination policies. The behavior source declares the policy as a per-node layout entry (not yet wired into the .bqbehavior metadata block; defaults toRequireAllfor now).
Members
Section titled “Members”RequireAll
Section titled “RequireAll”RequireAll = 0Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:35
Composite succeeds only when every child succeeds; fails as soon as any child fails. Default.
RequireOne
Section titled “RequireOne”RequireOne = 1Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Parallel.cs:41
Composite succeeds as soon as any child succeeds; fails only when every child has failed.
Selector
Section titled “Selector”Category: Node contracts
class BitQuirky.Behavior.Nodes.Composite.SelectorSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:42-107
Behavior-tree Selector (“priority OR”). Ticks children left-to-right; short-circuits on the first child to return Success; falls through to Failureonly when every child has failed.
Responsibilities:
- Encode the canonical Selector aggregation rule for the runtime tick job and bake-time validation.
- Provide the baked / token identity for cross-layer correspondence.
Does NOT:
- Hold per-instance state: runtime cursor lives on the per-follower BehaviorRuntimeInstance.
- Allocate managed memory (Burst-callable).
Members
Section titled “Members”public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = SelectorSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:52
Baked node kind a selector bakes to.
NodeKindToken
Section titled “NodeKindToken”public const string NodeKindToken = "selector"Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:48-49
Mermaid:::<token>suffix identifying this node type.
Mirrored byMermaidBehaviorSourceReader.
Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)
Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Selector.cs:67-106
Aggregation rule. Given the latest child’s status and the composite’s child cursor, decide whether to short-circuit (the selector itself is done) and which child the next tick should run.
ReturnsRunningwhen more
children remain to try; setsnextChildIndex
to the next child slot. Returns
Successon the first
child success orFailurewhen
the cursor walked off the end.
Sequence
Section titled “Sequence”Category: Node contracts
class BitQuirky.Behavior.Nodes.Composite.SequenceSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:41-98
Behavior-tree Sequence (“priority AND”). Ticks children left-to-right; short-circuits on the first child to return Failure; falls through to Successonly when every child has succeeded.
Responsibilities:
- Encode the canonical Sequence aggregation rule for the runtime tick job and bake-time validation.
- Provide the baked / token identity for cross-layer correspondence.
Does NOT:
- Hold per-instance state.
- Allocate managed memory (Burst-callable).
Members
Section titled “Members”public const BitQuirky.Behavior.Baked.BakedNodeKind Kind = SequenceSource declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:48
Baked node kind a sequence bakes to.
NodeKindToken
Section titled “NodeKindToken”public const string NodeKindToken = "sequence"Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:44-45
Kind token a sequence carries in authored graph source.
Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)
Section titled “Aggregate(BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)”public static BitQuirky.Behavior.Nodes.BehaviorNodeStatus Aggregate(BitQuirky.Behavior.Nodes.BehaviorNodeStatus latestChildStatus, int currentChildIndex, int totalChildren, out int nextChildIndex)Source declaration: Packages/io.bitquirky.behavior/Runtime/Nodes/Composite/Sequence.cs:58-97
Folds the status one child just returned into the composite’s status and names the child
to tick next. A succeeding child advances to the next sibling and reports Running until
the last child succeeds; a running child is re-ticked; any other status ends the
composite and is passed through unchanged, and an unrecognized status ends it as
Failure.nextChildIndexis the child index to tick next, or -1 when
the composite finished this tick.
Source fingerprint: sha256:ad0983d00d773d882bc61865e18d8c5559e009d181e5891575cd7f262515b23e