| Package | Description |
|---|---|
| com.almasb.fxgl.ai.btree | |
| com.almasb.fxgl.ai.btree.branch | |
| com.almasb.fxgl.ai.btree.decorator | |
| com.almasb.fxgl.ai.btree.leaf | |
| com.almasb.fxgl.ai.btree.utils |
| Modifier and Type | Class and Description |
|---|---|
class |
BehaviorTree<E>
The behavior tree itself.
|
class |
BranchTask<E>
A branch task defines a behavior tree branch, contains logic of starting or running sub-branches and leaves
|
class |
Decorator<E>
A
Decorator is a wrapper that provides custom behavior for its child. |
class |
LeafTask<E>
A
LeafTask is a terminal task of a behavior tree, contains action or condition logic, can not have any child. |
class |
LoopDecorator<E>
LoopDecorator is an abstract class providing basic functionalities for concrete looping decorators. |
class |
SingleRunningChildBranch<E>
A
SingleRunningChildBranch task is a branch task that supports only one running child at a time. |
| Modifier and Type | Field and Description |
|---|---|
protected Task<E> |
Decorator.child
The child task wrapped by this decorator
|
protected Task<E> |
Task.control
The parent of this task.
|
protected Task<E>[] |
SingleRunningChildBranch.randomChildren
Array of random children.
|
| Modifier and Type | Field and Description |
|---|---|
protected Array<Task<E>> |
BranchTask.children
The children of this branch task.
|
| Modifier and Type | Method and Description |
|---|---|
Task<E> |
Task.cloneTask()
Clones this task to a new one.
|
protected abstract Task<E> |
Task.copyTo(Task<E> task)
Copies this task to the given task.
|
protected Task<E> |
SingleRunningChildBranch.copyTo(Task<E> task) |
protected Task<E> |
Decorator.copyTo(Task<E> task) |
protected Task<E> |
BranchTask.copyTo(Task<E> task) |
protected Task<E> |
BehaviorTree.copyTo(Task<E> task) |
protected Task<E>[] |
SingleRunningChildBranch.createRandomChildren() |
abstract Task<E> |
Task.getChild(int i) |
Task<E> |
LeafTask.getChild(int i) |
Task<E> |
Decorator.getChild(int i) |
Task<E> |
BranchTask.getChild(int i) |
Task<E> |
BehaviorTree.getChild(int i) |
Task<E> |
Task.getGuard() |
| Modifier and Type | Method and Description |
|---|---|
int |
Task.addChild(Task<E> child)
This method will add a child to the list of this task's children
|
protected abstract int |
Task.addChildToTask(Task<E> child)
This method will add a child to the list of this task's children
|
protected int |
LeafTask.addChildToTask(Task<E> child)
Always throws
IllegalStateException because a leaf task cannot have any children. |
protected int |
Decorator.addChildToTask(Task<E> child) |
protected int |
BranchTask.addChildToTask(Task<E> child) |
protected int |
BehaviorTree.addChildToTask(Task<E> child)
This method will add a child, namely the root, to this behavior tree.
|
boolean |
Task.checkGuard(Task<E> control)
Checks the guard of this task.
|
void |
BehaviorTree.Listener.childAdded(Task<E> task,
int index)
This method is invoked when a child task is added to the children of a parent task.
|
abstract void |
Task.childFail(Task<E> task)
This method will be called when one of the children of this task fails.
|
void |
SingleRunningChildBranch.childFail(Task<E> task) |
void |
LeafTask.childFail(Task<E> runningTask) |
void |
Decorator.childFail(Task<E> runningTask) |
void |
BehaviorTree.childFail(Task<E> runningTask) |
abstract void |
Task.childRunning(Task<E> runningTask,
Task<E> reporter)
This method will be called when one of the ancestors of this task needs to run again.
|
abstract void |
Task.childRunning(Task<E> runningTask,
Task<E> reporter)
This method will be called when one of the ancestors of this task needs to run again.
|
void |
SingleRunningChildBranch.childRunning(Task<E> task,
Task<E> reporter) |
void |
SingleRunningChildBranch.childRunning(Task<E> task,
Task<E> reporter) |
void |
LoopDecorator.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
LoopDecorator.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
LeafTask.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
LeafTask.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
Decorator.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
Decorator.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
BehaviorTree.childRunning(Task<E> runningTask,
Task<E> reporter) |
void |
BehaviorTree.childRunning(Task<E> runningTask,
Task<E> reporter) |
abstract void |
Task.childSuccess(Task<E> task)
This method will be called when one of the children of this task succeeds.
|
void |
SingleRunningChildBranch.childSuccess(Task<E> task) |
void |
LeafTask.childSuccess(Task<E> runningTask) |
void |
Decorator.childSuccess(Task<E> runningTask) |
void |
BehaviorTree.childSuccess(Task<E> runningTask) |
protected abstract Task<E> |
Task.copyTo(Task<E> task)
Copies this task to the given task.
|
protected Task<E> |
SingleRunningChildBranch.copyTo(Task<E> task) |
protected Task<E> |
Decorator.copyTo(Task<E> task) |
protected Task<E> |
BranchTask.copyTo(Task<E> task) |
protected Task<E> |
BehaviorTree.copyTo(Task<E> task) |
void |
BehaviorTree.notifyChildAdded(Task<E> task,
int index) |
void |
BehaviorTree.notifyStatusUpdated(Task<E> task,
Task.Status previousStatus) |
void |
Task.setControl(Task<E> control)
This method will set a task as this task's control (parent).
|
void |
Task.setGuard(Task<E> guard)
Sets the guard of this task.
|
void |
BehaviorTree.Listener.statusUpdated(Task<E> task,
Task.Status previousStatus)
This method is invoked when the task status is set.
|
| Constructor and Description |
|---|
BehaviorTree(Task<E> rootTask)
Creates a behavior tree with a root task and no blackboard object.
|
BehaviorTree(Task<E> rootTask,
E object)
Creates a behavior tree with a root task and a blackboard object.
|
Decorator(Task<E> child)
Creates a decorator that wraps the given task.
|
LoopDecorator(Task<E> child)
Creates a loop decorator that wraps the given task.
|
| Constructor and Description |
|---|
BranchTask(Array<Task<E>> tasks)
Create a branch task with a list of children
|
SingleRunningChildBranch(Array<Task<E>> tasks)
Creates a
SingleRunningChildBranch task with a list of children |
| Modifier and Type | Class and Description |
|---|---|
class |
DynamicGuardSelector<E>
A
DynamicGuardSelector is a branch task that executes the first child whose guard is evaluated to true. |
class |
Parallel<E>
A
Parallel is a special branch task that starts or resumes all children every single time. |
class |
RandomSelector<E>
A
RandomSelector is a selector task's variant that runs its children in a random order. |
class |
RandomSequence<E>
A
RandomSequence is a sequence task's variant that runs its children in a random order. |
class |
Selector<E>
A
Selector is a branch task that runs every children until one of them succeeds. |
class |
Sequence<E>
A
Sequence is a branch task that runs every children until one of them fails. |
| Modifier and Type | Field and Description |
|---|---|
protected Task<E> |
DynamicGuardSelector.runningChild
The child in the running status or
null if no child is running. |
| Modifier and Type | Method and Description |
|---|---|
protected Task<E> |
Parallel.copyTo(Task<E> task) |
protected Task<E> |
DynamicGuardSelector.copyTo(Task<E> task) |
| Modifier and Type | Method and Description |
|---|---|
void |
Sequence.childFail(Task<E> runningTask) |
void |
Selector.childFail(Task<E> runningTask) |
void |
Parallel.childFail(Task<E> runningTask) |
void |
DynamicGuardSelector.childFail(Task<E> task) |
void |
Parallel.childRunning(Task<E> task,
Task<E> reporter) |
void |
Parallel.childRunning(Task<E> task,
Task<E> reporter) |
void |
DynamicGuardSelector.childRunning(Task<E> task,
Task<E> reporter) |
void |
DynamicGuardSelector.childRunning(Task<E> task,
Task<E> reporter) |
void |
Sequence.childSuccess(Task<E> runningTask) |
void |
Selector.childSuccess(Task<E> runningTask) |
void |
Parallel.childSuccess(Task<E> runningTask) |
void |
DynamicGuardSelector.childSuccess(Task<E> task) |
protected Task<E> |
Parallel.copyTo(Task<E> task) |
protected Task<E> |
DynamicGuardSelector.copyTo(Task<E> task) |
| Constructor and Description |
|---|
DynamicGuardSelector(Task<E>... tasks)
Creates a
DynamicGuardSelector branch with the given children. |
Parallel(Parallel.Policy policy,
Task<E>... tasks)
Creates a parallel task with the given policy and children
|
Parallel(Task<E>... tasks)
Creates a parallel task with sequence policy and the given children
|
RandomSelector(Task<E>... tasks)
Creates a
RandomSelector branch with the given children. |
RandomSequence(Task<E>... tasks)
Creates a
RandomSequence branch with the given children. |
Selector(Task<E>... tasks)
Creates a
Selector branch with the given children. |
Sequence(Task<E>... tasks)
Creates a
Sequence branch with the given children. |
| Constructor and Description |
|---|
DynamicGuardSelector(Array<Task<E>> tasks)
Creates a
DynamicGuardSelector branch with the given children. |
Parallel(Array<Task<E>> tasks)
Creates a parallel task with sequence policy and the given children
|
Parallel(Parallel.Policy policy,
Array<Task<E>> tasks)
Creates a parallel task with the given policy and children
|
RandomSelector(Array<Task<E>> tasks)
Creates a
RandomSelector branch with the given children. |
RandomSequence(Array<Task<E>> tasks)
Creates a
RandomSequence branch with the given children. |
Selector(Array<Task<E>> tasks)
Creates a
Selector branch with the given children. |
Sequence(Array<Task<E>> tasks)
Creates a
Sequence branch with the given children. |
| Modifier and Type | Class and Description |
|---|---|
class |
AlwaysFail<E>
An
AlwaysFail decorator will fail no matter the wrapped task fails or succeeds. |
class |
AlwaysSucceed<E>
An
AlwaysSucceed decorator will succeed no matter the wrapped task succeeds or fails. |
class |
Include<E>
An
Include decorator grafts a subtree. |
class |
Invert<E>
An
Invert decorator will succeed if the wrapped task fails and will fail if the wrapped task succeeds. |
class |
Random<E>
The
Random decorator succeeds with the specified probability, regardless of whether the wrapped task fails or succeeds. |
class |
Repeat<E>
A
Repeat decorator will repeat the wrapped task a certain number of times, possibly infinite. |
class |
SemaphoreGuard<E>
A
SemaphoreGuard decorator allows you to specify how many characters should be allowed to concurrently execute its
child which represents a limited resource used in different behavior trees (note that this does not necessarily involve
multithreading concurrency). |
class |
UntilFail<E>
The
UntilFail decorator will repeat the wrapped task until that task fails, which makes the decorator succeed. |
class |
UntilSuccess<E>
The
UntilSuccess decorator will repeat the wrapped task until that task succeeds, which makes the decorator succeed. |
| Modifier and Type | Method and Description |
|---|---|
Task<E> |
Include.cloneTask()
Returns a clone of the referenced subtree if this
Import is eager; otherwise returns a clone of itself. |
protected Task<E> |
SemaphoreGuard.copyTo(Task<E> task) |
protected Task<E> |
Repeat.copyTo(Task<E> task) |
protected Task<E> |
Random.copyTo(Task<E> task) |
protected Task<E> |
Include.copyTo(Task<E> task)
Copies this
Include to the given task. |
| Modifier and Type | Method and Description |
|---|---|
void |
UntilSuccess.childFail(Task<E> runningTask) |
void |
UntilFail.childFail(Task<E> runningTask) |
void |
Repeat.childFail(Task<E> runningTask) |
void |
Random.childFail(Task<E> runningTask) |
void |
Invert.childFail(Task<E> runningTask) |
void |
AlwaysSucceed.childFail(Task<E> runningTask) |
void |
UntilSuccess.childSuccess(Task<E> runningTask) |
void |
UntilFail.childSuccess(Task<E> runningTask) |
void |
Repeat.childSuccess(Task<E> runningTask) |
void |
Random.childSuccess(Task<E> runningTask) |
void |
Invert.childSuccess(Task<E> runningTask) |
void |
AlwaysFail.childSuccess(Task<E> runningTask) |
protected Task<E> |
SemaphoreGuard.copyTo(Task<E> task) |
protected Task<E> |
Repeat.copyTo(Task<E> task) |
protected Task<E> |
Random.copyTo(Task<E> task) |
protected Task<E> |
Include.copyTo(Task<E> task)
Copies this
Include to the given task. |
| Constructor and Description |
|---|
AlwaysFail(Task<E> task)
Creates an
AlwaysFail decorator with the given child. |
AlwaysSucceed(Task<E> task)
Creates an
AlwaysSucceed decorator with the given child. |
Invert(Task<E> task)
Creates an
Invert decorator with the given child. |
Random(FloatDistribution success,
Task<E> task)
Creates a
Random decorator with the given child that succeeds with the specified probability. |
Random(Task<E> task)
Creates a
Random decorator with the given child that succeeds or fails with equal probability. |
Repeat(IntegerDistribution times,
Task<E> child)
Creates a repeat decorator that executes the given task the number of times (possibly infinite) determined by the given
distribution.
|
Repeat(Task<E> child)
Creates an infinite repeat decorator that wraps the given task.
|
SemaphoreGuard(String name,
Task<E> task)
Creates a
SemaphoreGuard decorator with the specified semaphore name and child. |
SemaphoreGuard(Task<E> task)
Creates a
SemaphoreGuard decorator with the given child. |
UntilFail(Task<E> task)
Creates an
UntilFail decorator with the given child. |
UntilSuccess(Task<E> task)
Creates an
UntilSuccess decorator with the given child. |
| Modifier and Type | Class and Description |
|---|---|
class |
Failure<E>
Failure is a leaf that immediately fails. |
class |
Success<E>
Success is a leaf that immediately succeeds. |
class |
Wait<E>
Wait is a leaf that keeps running for the specified amount of time then succeeds. |
| Modifier and Type | Method and Description |
|---|---|
protected Task<E> |
Wait.copyTo(Task<E> task) |
protected Task<E> |
Success.copyTo(Task<E> task) |
protected Task<E> |
Failure.copyTo(Task<E> task) |
| Modifier and Type | Method and Description |
|---|---|
protected Task<E> |
Wait.copyTo(Task<E> task) |
protected Task<E> |
Success.copyTo(Task<E> task) |
protected Task<E> |
Failure.copyTo(Task<E> task) |
| Modifier and Type | Field and Description |
|---|---|
Task<E> |
BehaviorTreeParser.DefaultBehaviorTreeReader.StackedTask.task |
| Modifier and Type | Method and Description |
|---|---|
<T> Task<T> |
BehaviorTreeLibraryManager.createRootTask(String treeReference)
Creates the root task of
BehaviorTree for the specified reference. |
<T> Task<T> |
BehaviorTreeLibrary.createRootTask(String treeReference)
Creates the root task of
BehaviorTree for the specified reference. |
Task<E> |
BehaviorTreeParser.DefaultBehaviorTreeReader.Subtree.rootTaskInstance() |
| Modifier and Type | Method and Description |
|---|---|
protected BehaviorTree<E> |
BehaviorTreeParser.createBehaviorTree(Task<E> root,
E object) |
void |
BehaviorTreeParser.DefaultBehaviorTreeReader.Subtree.init(Task<E> rootTask) |
protected static <E> void |
BehaviorTreeParser.printTree(Task<E> task,
int indent) |
Copyright © 2018. All rights reserved.