Learn R Programming

rgp (version 0.4-1)

makePopulation: Classes for populations of individuals represented as functions

Description

makePopulation creates a population of untyped individuals, whereas makeTypedPopulation creates a population of typed individuals. fastMakePopulation is a faster variant of makePopulation with fewer options. print.population prints the population. summary.population returns a summary view of a population.

Usage

makePopulation(size, funcset, inset, conset, maxfuncdepth = 8, constprob = 0.2, breedingFitness = function(individual) TRUE, breedingTries = 50, extinctionPrevention = FALSE, funcfactory = NULL)
fastMakePopulation(size, funcset, inset, maxfuncdepth, constMin, constMax)
makeTypedPopulation(size, type, funcset, inset, conset, maxfuncdepth = 8, constprob = 0.2, breedingFitness = function(individual) TRUE, breedingTries = 50, extinctionPrevention = FALSE, funcfactory = NULL)
"print"(x, ...)
"summary"(object, ...)

Arguments

size
The population size in number of individuals.
type
The (range) type of the individual functions to create.
funcset
The function set.
inset
The set of input variables.
conset
The set of constant factories.
constMin
For fastMakePopulation, the minimum constant to create.
constMax
For fastMakePopulation, the maximum constant to create.
maxfuncdepth
The maximum depth of the functions of the new population.
constprob
The probability of generating a constant in a step of growth, if no subtree is generated. If neither a subtree nor a constant is generated, a randomly chosen input variable will be generated. Defaults to 0.2.
breedingFitness
A breeding function. See the documentation for geneticProgramming for details.
breedingTries
The number of breeding steps.
extinctionPrevention
When set to TRUE, initialization will try to prevent duplicate individuals from occurring in the population. Defaults to FALSE, as this operation might be expensive with larger population sizes.
funcfactory
A factory for creating the functions of the new population. Defaults to Koza's "ramped half-and-half" initialization strategy.
x
The population to print.
object
The population to summarize.
...
Additional parameters to the print or summary (passed on to their default implementation).

Value

A new population of functions.