Click or drag to resize
Parallel Class
The Parallel composite acts in a similar way to the Sequence composite. It has a set of child tasks, and it runs them until one of them fails. At that point, the Parallel task as a whole fails. If all of the child tasks complete successfully, the Parallel task returns with success. In this way, it is identical to the Sequence task and its non-deterministic variations. The difference is the way it runs those tasks. Rather than running them one at a time, it runs them all simultaneously. We can think of it as creating a bunch of new threads, one per child, and setting the child tasks off together.
Inheritance Hierarchy
SystemObject
  Slash.AI.BehaviorTrees.ImplementationsTask
    Slash.AI.BehaviorTrees.ImplementationsBaseTaskParallelData
      Slash.AI.BehaviorTrees.Implementations.CompositesCompositeParallelData
        Slash.AI.BehaviorTrees.Implementations.CompositesParallel

Namespace: Slash.AI.BehaviorTrees.Implementations.Composites
Assembly: Slash.AI.BehaviorTrees (in Slash.AI.BehaviorTrees.dll) Version: 1.0.6018.40184
Syntax
[SerializableAttribute]
public class Parallel : Composite<ParallelData>

The Parallel type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyMainTask
Main task. If set the parallel will run as long as the main task runs. When the main task ends, all other tasks which still run are aborted. If not set the parallel will run as long as any task runs.
Public propertyMainTaskIndex
Xml serialization of the main task index.
Top
Methods
  NameDescription
Public methodActivate
Activation. This method is called when the task was chosen to be executed. It's called right before the first update of the task. The task can setup its specific task data in here and do initial actions.
(Overrides BaseTaskTTaskDataActivate(IAgentData, IDecisionData).)
Public methodDeactivate
Deactivation.
(Overrides BaseTaskTTaskDataDeactivate(IAgentData).)
Public methodDecide
Depending on the group policy of its parent, the floating point return value indicates whether the task will be activated.
(Overrides TaskDecide(IAgentData, IDecisionData).)
Public methodEquals(Object)
The equals.
(Overrides CompositeTTaskDataEquals(Object).)
Public methodEquals(Parallel)
The equals.
Public methodGetActiveTasks
Generates a collection of active task nodes under this task. Used for debugging only.
(Overrides TaskGetActiveTasks(IAgentData, TaskNode, ICollectionTaskNode).)
Public methodGetHashCode
The get hash code.
(Overrides CompositeTTaskDataGetHashCode.)
Public methodUpdate
Per frame update.
(Overrides TaskUpdate(IAgentData).)
Top
See Also