Safe Haskell | None |
---|
AI strategies to direct actors not controlled directly by human players.
No operation in this module involves the State
or Action
type.
- data Strategy a
- nullStrategy :: Strategy a -> Bool
- liftFrequency :: Frequency a -> Strategy a
- (.|) :: Strategy a -> Strategy a -> Strategy a
- reject :: Strategy a
- (.=>) :: Bool -> Strategy a -> Strategy a
- only :: (a -> Bool) -> Strategy a -> Strategy a
- bestVariant :: Strategy a -> Frequency a
- renameStrategy :: Text -> Strategy a -> Strategy a
- returN :: Text -> a -> Strategy a
Documentation
data Strategy a
A strategy is a choice of (non-empty) frequency tables of possible actions.
nullStrategy :: Strategy a -> Bool
liftFrequency :: Frequency a -> Strategy a
Strategy where only the actions from the given single frequency table can be picked.
(.|) :: Strategy a -> Strategy a -> Strategy a
Strategy with the actions from both argument strategies, with original frequencies.
only :: (a -> Bool) -> Strategy a -> Strategy a
Strategy with all actions not satisfying the predicate removed. The remaining actions keep their original relative frequency values.
bestVariant :: Strategy a -> Frequency a
When better choices are towards the start of the list, this is the best frequency of the strategy.
renameStrategy :: Text -> Strategy a -> Strategy a
Overwrite the description of all frequencies within the strategy.