Copyright | (c) Peter Lu 2018 |
---|---|
License | GPL-3 |
Maintainer | chippermonky@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class SelfActionable p o where
- apply :: o -> p -> p
- reduce :: SelfActionable p o => [o] -> p -> p
- data Status
- newtype NodeSequenceT g p o m a = NodeSequenceT {
- runNodeSequenceT :: g -> p -> m (a, g, p, Status, [o])
- execNodeSequenceT :: Monad m => NodeSequenceT g p o m a -> g -> p -> m (g, p, Status, [o])
- execNodeSequenceTimesT :: (SelfActionable p o, Monad m) => Int -> NodeSequenceT g p o m a -> g -> p -> m (g, p, Status, [o])
- execNodeSequenceTimesFinalizeT :: (SelfActionable p o, Monad m) => Int -> NodeSequenceT g p o m a -> g -> p -> m p
- type NodeSequence g p o a = NodeSequenceT g p o Identity a
- runNodeSequence :: NodeSequence g p o a -> g -> p -> (a, g, p, Status, [o])
- execNodeSequence :: NodeSequence g p o a -> g -> p -> (g, p, Status, [o])
- execNodeSequenceTimes :: SelfActionable p o => Int -> NodeSequence g p o a -> g -> p -> (g, p, Status, [o])
- execNodeSequenceTimesFinalize :: SelfActionable p o => Int -> NodeSequence g p o a -> g -> p -> p
- getPerception :: Monad m => NodeSequenceT g p o m p
- setPerception :: Monad m => p -> NodeSequenceT g p o m ()
- tellOutput :: Monad m => o -> NodeSequenceT g p o m ()
- getGenerator :: Monad m => NodeSequenceT g p o m g
- setGenerator :: Monad m => g -> NodeSequenceT g p o m ()
Documentation
class SelfActionable p o where Source #
Instances
SelfActionable a (a -> a) Source # | |
Defined in Smarties.Base |
reduce :: SelfActionable p o => [o] -> p -> p Source #
reduce a list of actions and apply it the perception
newtype NodeSequenceT g p o m a Source #
behavior tree sequence monad type
g
is rng type
p
is perception type (state)
o
is output type
behavior tree output list is ordered from right to left, i.e. use foldr when applying
this looks a lot like (StateT (g,p) Writer o) but behaves differently when nodes fail
NodeSequenceT | |
|
Instances
execNodeSequenceT :: Monad m => NodeSequenceT g p o m a -> g -> p -> m (g, p, Status, [o]) Source #
run a node sequence and throw out its monadic output
execNodeSequenceTimesT :: (SelfActionable p o, Monad m) => Int -> NodeSequenceT g p o m a -> g -> p -> m (g, p, Status, [o]) Source #
run a node sequence several times using its output to generate the next perception state
execNodeSequenceTimesFinalizeT :: (SelfActionable p o, Monad m) => Int -> NodeSequenceT g p o m a -> g -> p -> m p Source #
same as runNodeSequenceTequenceTimes
except reduces the final input with its output and only returns this result
type NodeSequence g p o a = NodeSequenceT g p o Identity a Source #
runNodeSequence :: NodeSequence g p o a -> g -> p -> (a, g, p, Status, [o]) Source #
execNodeSequence :: NodeSequence g p o a -> g -> p -> (g, p, Status, [o]) Source #
execNodeSequenceTimes :: SelfActionable p o => Int -> NodeSequence g p o a -> g -> p -> (g, p, Status, [o]) Source #
execNodeSequenceTimesFinalize :: SelfActionable p o => Int -> NodeSequence g p o a -> g -> p -> p Source #
getPerception :: Monad m => NodeSequenceT g p o m p Source #
returns the perception
setPerception :: Monad m => p -> NodeSequenceT g p o m () Source #
sets the perception
tellOutput :: Monad m => o -> NodeSequenceT g p o m () Source #
add an item to the output
getGenerator :: Monad m => NodeSequenceT g p o m g Source #
returns the rng
setGenerator :: Monad m => g -> NodeSequenceT g p o m () Source #
sets the rng