Skip to content

LooperNode

ErrWare edited this page Aug 8, 2018 · 1 revision

These nodes are meant to be internal nodes in a task tree. They aggregate other nodes and select which ones to add to the TaskTree trace during their execution. They are not meant to interact with the world, other than maybe querying information - which should be restricted to occur in the isValid/isInvalid methods.

The LooperNode maintains a List of children. At each execution step it iterates through the children according to its set LooperBehaviour, adding the first valid child to the calling TaskTree's trace and executing it.

I haven't yet spent time making LooperNode easily modifiable, but for now it works. Ideas for the future: Make making new LooperBehaviours easier - as it is now the options are hard coded in the LooperNode setExecutionType method Allow any arbitrary iterable to be the container of the children - I went with list to make it a simple matter to create LooperNodes: simply add each child to the node once created. Previously I had to make a concrete Iterable, add the desired children to it, then set it as the Iterable<> nodes within LooperNode.

Clone this wiki locally