Click or drag to resize
Accord.NET (logo)

Population Constructor

Initializes a new instance of the Population class.

Namespace:  Accord.Genetic
Assembly:  Accord.Genetic (in Accord.Genetic.dll) Version: 3.7.0
Syntax
public Population(
	int size,
	IChromosome ancestor,
	IFitnessFunction fitnessFunction,
	ISelectionMethod selectionMethod
)
Request Example View Source

Parameters

size
Type: SystemInt32
Initial size of population.
ancestor
Type: Accord.GeneticIChromosome
Ancestor chromosome to use for population creatioin.
fitnessFunction
Type: Accord.GeneticIFitnessFunction
Fitness function to use for calculating chromosome's fitness values.
selectionMethod
Type: Accord.GeneticISelectionMethod
Selection algorithm to use for selection chromosome's to new generation.
Exceptions
ExceptionCondition
ArgumentExceptionToo small population's size was specified. The exception is thrown in the case if size is smaller than 2.
Remarks
Creates new population of specified size. The specified ancestor becomes first member of the population and is used to create other members with same parameters, which were used for ancestor's creation.
See Also