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
populationPopulation<TIndividual>The populations.
individualsIEnumerable<TIndividual>The individuals.
Returns
- Population<TIndividual>
The extended population.
Type Parameters
TIndividualThe 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
populationPopulation<TIndividual>The populations.
countintThe count of individuals to add.
individualFunc<TIndividual>The function to generate the individuals.
Returns
- Population<TIndividual>
The extended population.
Type Parameters
TIndividualThe 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
populationPopulation<TIndividual>The populations.
countintThe count of individuals to add.
paramTParamThe parameter that is passed to the factory.
individualFunc<TParam, TIndividual>The function to generate the individuals.
Returns
- Population<TIndividual>
The extended population.
Type Parameters
TIndividualThe individuals type.
TParamThe 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
populationPopulation<TIndividual>The populations.
countintThe count of individuals to add.
param1TParam1The first parameter that is passed to the factory.
param2TParam2The second parameter that is passed to the factory.
individualFunc<TParam1, TParam2, TIndividual>The function to generate the individuals.
Returns
- Population<TIndividual>
The extended population.
Type Parameters
TIndividualThe individuals type.
TParam1The type of the first parameter that is passed to the factory.
TParam2The 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
Returns
- Population<TIndividual>
The population.
Type Parameters
TIndividualThe 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
populationPopulation<TIndividual>The parent generation.
randomRandomThe random generator that is used by the operators.
Returns
- Offspring<TIndividual>
The offspring.
Type Parameters
TIndividualThe individuals type.