Learn R Programming

rgp (version 0.4-1)

makeFunctionFitnessFunction: Create a fitness function from a reference function of one variable

Description

Creates a fitness function that calculates an error measure with respect to an arbitrary reference function of one variable on the sequence of fitness cases seq(from, to, length = steps). When an indsizelimit is given, individuals exceeding this limit will receive a fitness of Inf.

Usage

makeFunctionFitnessFunction(func, from = -1, to = 1, steps = 128, errorMeasure = rmse, indsizelimit = NA)

Arguments

func
The reference function.
from
The start of the sequence of fitness cases.
to
The end of the sequence of fitness cases.
steps
The number of steps in the sequence of fitness cases.
errorMeasure
A function to use as an error measure, defaults to RMSE.
indsizelimit
Individuals exceeding this size limit will get a fitness of Inf.

Value

A fitness function based on the reference function func.