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

IT.Algorithms

Description

Definitions for a Solution, Population of solutions, fitness function and mutation function.

Synopsis

Documentation

data Solution Source #

data type containing a solution, its fitness and weight vector a refers to the type of Expr, b refers to a container of statistics.

Constructors

Sol 

Fields

Instances

Instances details
Eq Solution Source #

These instances are only to find the best and worst individuals of a population.

Instance details

Defined in IT.Algorithms

Methods

(==) :: Solution -> Solution -> Bool

(/=) :: Solution -> Solution -> Bool

Ord Solution Source # 
Instance details

Defined in IT.Algorithms

Methods

compare :: Solution -> Solution -> Ordering

(<) :: Solution -> Solution -> Bool

(<=) :: Solution -> Solution -> Bool

(>) :: Solution -> Solution -> Bool

(>=) :: Solution -> Solution -> Bool

max :: Solution -> Solution -> Solution

min :: Solution -> Solution -> Solution

Show Solution Source # 
Instance details

Defined in IT.Algorithms

Methods

showsPrec :: Int -> Solution -> ShowS

show :: Solution -> String

showList :: [Solution] -> ShowS

NFData Solution Source # 
Instance details

Defined in IT.Algorithms

Methods

rnf :: Solution -> ()

type Population = [Solution] Source #

A population of 'Solution a b'

type Fitness = Expr -> Maybe Solution Source #

Fitness function that takes a list of expressions and returns an evaluated population. This function is a good candidate for parallelization. type Fitness a b = [Expr a] -> Population a b -- (Expr a, Double, b)

type Constraint = Expr -> [Double] -> Double Source #

Constraint is a function that receives an expression and its coefficients and return the penalty associated with the constraint violation.

type Mutation = Expr -> Rnd Expr Source #

Mutation function with signature 'Solution a b -> Rnd (Solution a b)'