Copyright | (c) Peter Lu 2018 |
---|---|
License | GPL-3 |
Maintainer | chippermonky@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- selector :: Monad m => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a
- weightedSelector :: (RandomGen g, Ord w, Num w, Random w, Monad m) => [(w, NodeSequenceT g p o m a)] -> NodeSequenceT g p o m a
- utilitySelector :: (Ord a, NotUnit a ~ True, Monad m) => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a
- 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
- flipResult :: Monad m => NodeSequenceT g p o m a -> NodeSequenceT g p o m a
- result :: Monad m => Status -> NodeSequenceT g p o m ()
- condition :: Monad m => Bool -> NodeSequenceT g p o m ()
- rand :: (RandomGen g, Monad m) => Float -> NodeSequenceT g p o m ()
Documentation
control nodes
selector :: Monad m => [NodeSequenceT g p o m a] -> NodeSequenceT g p o m a Source #
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 NodeSequence
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 N.B. that this will dry execute ALL node sequences in the input list so be mindful of performance
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 N.B. that this will dry execute ALL node sequences in the input list so be mindful of performance
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 #
decorator that flips the status (FAIL -> SUCCESS, SUCCES -> FAIL)
conditions | has given status