smarties-1.2.1: Haskell Behavior Tree Library

Copyright(c) Peter Lu 2018
LicenseGPL-3
Maintainerchippermonky@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Smarties.Nodes

Description

 
Synopsis

Documentation

 

selector :: Monad m => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a Source #

dry run nodes in the input list until one has status SUCCESS and returns that node

weightedSelector :: (RandomGen g, Ord w, Num w, Random w, Monad m) => [(w, NodeSequenceT g p o m a)] -> NodeSequenceT g p o m a Source #

makes a weighted random selection on a list of nodes and weights this only runs the selected node

utilitySelector :: (Ord a, NotUnit a ~ True, Monad m) => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a Source #

returns the node sequence with maximum utility this will dry execute ALL nodes in the input list

utilityWeightedSelector :: (RandomGen g, Random a, Num a, Ord a, NotUnit a ~ True, Monad m) => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a Source #

makes a weighted random selection on a list of nodes with weights calculated using their monadic return value this will dry execute ALL nodes in the input list

decorators run a nodesequence and do something with it's results

flipResult :: Monad m => NodeSequenceT g p o m a -> NodeSequenceT g p o m a Source #

flips the status of a node

| creates a node that has the input status

result :: Monad m => Status -> NodeSequenceT g p o m () Source #

condition :: Monad m => Bool -> NodeSequenceT g p o m () Source #

creates a condition node SUCCESS if input is true FAIL otherwise

rand Source #

Arguments

:: (RandomGen g, Monad m) 
=> Float

chance of success ∈ [0,1]

-> NodeSequenceT g p o m () 

creates a node with random status based on input chance