Table of Contents

Class Population

Namespace
Evolutionary
Assembly
Evolutionary.dll

Provides creation and selection operators for the Population<TIndividual> class.

public static class Population
Inheritance
Population
Inherited Members

Methods

AddIndividuals<TIndividual>(Population<TIndividual>, IEnumerable<TIndividual>)

Adds some individuals to the population.

public static Population<TIndividual> AddIndividuals<TIndividual>(this Population<TIndividual> population, IEnumerable<TIndividual> individuals)

Parameters

population Population<TIndividual>

The populations.

individuals IEnumerable<TIndividual>

The individuals.

Returns

Population<TIndividual>

The extended population.

Type Parameters

TIndividual

The individuals type.

AddIndividuals<TIndividual>(Population<TIndividual>, int, Func<TIndividual>)

Adds count individuals that are created by the individual factory.

public static Population<TIndividual> AddIndividuals<TIndividual>(this Population<TIndividual> population, int count, Func<TIndividual> individual)

Parameters

population Population<TIndividual>

The populations.

count int

The count of individuals to add.

individual Func<TIndividual>

The function to generate the individuals.

Returns

Population<TIndividual>

The extended population.

Type Parameters

TIndividual

The individuals type.

AddIndividuals<TIndividual, TParam>(Population<TIndividual>, int, TParam, Func<TParam, TIndividual>)

Adds count individuals that are created by the individual factory. The factory receives the param parameter, for example a random generator.

public static Population<TIndividual> AddIndividuals<TIndividual, TParam>(this Population<TIndividual> population, int count, TParam param, Func<TParam, TIndividual> individual)

Parameters

population Population<TIndividual>

The populations.

count int

The count of individuals to add.

param TParam

The parameter that is passed to the factory.

individual Func<TParam, TIndividual>

The function to generate the individuals.

Returns

Population<TIndividual>

The extended population.

Type Parameters

TIndividual

The individuals type.

TParam

The type of the parameter that is passed to the factory.

AddIndividuals<TIndividual, TParam1, TParam2>(Population<TIndividual>, int, TParam1, TParam2, Func<TParam1, TParam2, TIndividual>)

Adds count individuals that are created by the individual factory. The factory receives the param1 and param2 parameters, for example a dimension and a random generator.

public static Population<TIndividual> AddIndividuals<TIndividual, TParam1, TParam2>(this Population<TIndividual> population, int count, TParam1 param1, TParam2 param2, Func<TParam1, TParam2, TIndividual> individual)

Parameters

population Population<TIndividual>

The populations.

count int

The count of individuals to add.

param1 TParam1

The first parameter that is passed to the factory.

param2 TParam2

The second parameter that is passed to the factory.

individual Func<TParam1, TParam2, TIndividual>

The function to generate the individuals.

Returns

Population<TIndividual>

The extended population.

Type Parameters

TIndividual

The individuals type.

TParam1

The type of the first parameter that is passed to the factory.

TParam2

The type of the second parameter that is passed to the factory.

Create<TIndividual>(Func<TIndividual, double>)

Creates a new population with zero individuals.

public static Population<TIndividual> Create<TIndividual>(Func<TIndividual, double> fitness)

Parameters

fitness Func<TIndividual, double>

The fitness function.

Returns

Population<TIndividual>

The population.

Type Parameters

TIndividual

The individuals type.

SelectParentsByRank<TIndividual>(Population<TIndividual>, Random)

Generates an initial offspring generation. The random parents are selected by rank lineary.

public static Offspring<TIndividual> SelectParentsByRank<TIndividual>(this Population<TIndividual> population, Random random)

Parameters

population Population<TIndividual>

The parent generation.

random Random

The random generator that is used by the operators.

Returns

Offspring<TIndividual>

The offspring.

Type Parameters

TIndividual

The individuals type.