Copyright(c) Fabricio Olivetti de Franca 2020
LicenseGPL-3
Maintainerfabricio.olivetti@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone

IT.Mutation

Description

Mutation operators.

Synopsis

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.

dropTerm :: Mutation Source #

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

rndReplaceStrength :: Int -> Term -> Int -> Int -> Rnd Term Source #

replaces a strength at random

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

mutFun Source #

Arguments

:: Int

Dim

-> (Int, Int)

minExp, maxExp

-> (Int, Int)

minTerms, maxTerms

-> Rnd Term

random term generator

-> Rnd Transformation

random term generator

-> Expr

Expression to be mutated

-> Rnd Expr

Random Expression generator

Apply one of the mutation functions at random