Helpful utility functions for our chromosomes. More...
#include <BTChromosomeUtils.h>
Static Public Member Functions | |
static bool | FindRandomNodeOfType (UBTChromosome *chromosome, URandomGen *random, UClass *nodeClass, UBTCompositeNodeGene *&outParent, uint16 &outChildIdx, UBTNodeGene *&resultNode) |
template<typename NodeT > | |
static bool | FindRandomNode (UBTChromosome *chromosome, URandomGen *randomGen, UBTCompositeNodeGene *&outParent, uint16 &outChildIdx, NodeT *&resultNode) |
static int | CountNumNodesOfType (UBTChromosome *chromosome, UClass *nodeClass) |
template<typename NodeT > | |
static int | CountNumNodes (UBTChromosome *chromosome) |
static void | DepthFirstSearch (UBTChromosome *chromosome, std::function< bool(UBTNodeGene *, UBTCompositeNodeGene *, uint16)> nodeFunc) |
Performs a depth-first search on the given chromsome, calling a given function on each node. More... | |
static bool | DepthFirstSearch (UBTCompositeNodeGene *composite, UBTCompositeNodeGene *parent, uint16 compositeIdx, std::function< bool(UBTNodeGene *, UBTCompositeNodeGene *, uint16)> nodeFunc, TArray< UBTNodeGene * > seenNodes) |
static bool | ContainsACycle (UBTChromosome *chromosome) |
static int | DepthOfTree (UBTChromosome *chromosome) |
static bool | CheckForPointerCollisions (UBTCompositeNodeGene *composite, UBTCompositeNodeGene *other) |
static bool | CheckForPointerCollisions (UBTChromosome *chromosome, UBTChromosome *other) |
static bool | PickNodeAtLayer (UBTChromosome *chromosome, int layer, UBTCompositeNodeGene *&outParent, uint16 &outChildIdx, UBTNodeGene *&resultNode) |
Helpful utility functions for our chromosomes.
|
static |
Performs a depth-first search on the given chromsome, calling a given function on each node.
chromosome | The chromosome to search. |
nodeFunc | The function to call on each node in the chromosome. |