Copyright | (c) Fabricio Olivetti de Franca 2020 |
---|---|
License | GPL-3 |
Maintainer | fabricio.olivetti@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
IT.Mutation
Contents
Description
Mutation operators.
Synopsis
- addTerm :: Rnd Term -> Mutation
- dropTerm :: Mutation
- replaceTerm :: Int -> Int -> Int -> Mutation
- rndReplaceStrength :: Int -> Term -> Int -> Int -> Rnd Term
- replaceTrans :: Rnd Transformation -> Mutation
- combineInter :: (Int -> Int -> Int) -> Int -> Int -> Mutation
- positiveInter :: Int -> Int -> Mutation
- negativeInter :: Int -> Int -> Mutation
- mutFun :: Int -> (Int, Int) -> (Int, Int) -> Rnd Term -> Rnd Transformation -> Expr -> Rnd Expr
Mutation builder functions
addTerm :: Rnd Term -> Mutation Source #
Create an Add new term mutation.
Adds a random term into the expression. If this term already exists in the expression, it returns the original expression without modification.
You need to provide a Fitness function and a function that samples a random term.
Create a Drop term mutation.
Drops a random term of the expression.
You need to provide a Fitness function.
replaceTerm :: Int -> Int -> Int -> Mutation Source #
Create a Random Replace Term mutation
Replace one random strength of a random term of the expression. You need to provide the minimum and maximum allowed exponent
replaceTrans :: Rnd Transformation -> Mutation Source #
replaces a random transformation function
combineInter :: (Int -> Int -> Int) -> Int -> Int -> Mutation Source #
Combine two interactions with op
operation (use (+) or (-)
for positive and negative interaction)
positiveInter :: Int -> Int -> Mutation Source #
Positive and Negative interaction mutations
negativeInter :: Int -> Int -> Mutation Source #
Positive and Negative interaction mutations