Copyright | (c) Fabricio Olivetti de Franca 2022 |
---|---|
License | GPL-3 |
Maintainer | fabricio.olivetti@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Mutation operators.
Synopsis
- toss :: Rnd Bool
- randomChoice :: Rnd a -> Rnd a -> Rnd a
- trd :: Pi -> [(Int, Int)]
- countVars :: Sigma -> Int
- applyMut :: MutationCfg -> Individual -> (MutationCfg -> TIR -> Rnd TIR) -> Rnd Individual
- multiMut :: MutationCfg -> Individual -> Rnd Individual
- insertNode :: MutationCfg -> TIR -> Rnd TIR
- removeNode :: MutationCfg -> TIR -> Rnd TIR
- changeVar :: MutationCfg -> TIR -> Rnd TIR
- changeExponent :: MutationCfg -> TIR -> Rnd TIR
- changeFun :: MutationCfg -> TIR -> Rnd TIR
- replaceSubTree :: MutationCfg -> TIR -> Rnd TIR
Documentation
randomChoice :: Rnd a -> Rnd a -> Rnd a Source #
applyMut :: MutationCfg -> Individual -> (MutationCfg -> TIR -> Rnd TIR) -> Rnd Individual Source #
multiMut :: MutationCfg -> Individual -> Rnd Individual Source #
Multi-mutation, it applies one of the following mutations at random:
- insertNode
- removeNode
- changeVar
- changeExponent
- changeFun
insertNode :: MutationCfg -> TIR -> Rnd TIR Source #
inserts a random node
removeNode :: MutationCfg -> TIR -> Rnd TIR Source #
removes a random node
changeExponent :: MutationCfg -> TIR -> Rnd TIR Source #
changes a random exponent.
replaceSubTree :: MutationCfg -> TIR -> Rnd TIR Source #
replaces a subtree at random (not yet implemented).