Click or drag to resize
Accord.NET (logo)

PopulationResize Method (Int32, ISelectionMethod)

Resize population to the new specified size.

Namespace:  Accord.Genetic
Assembly:  Accord.Genetic (in Accord.Genetic.dll) Version: 3.8.0
Syntax
public void Resize(
	int newPopulationSize,
	ISelectionMethod membersSelector
)
Request Example View Source

Parameters

newPopulationSize
Type: SystemInt32
New size of population.
membersSelector
Type: Accord.GeneticISelectionMethod
Selection algorithm to use in the case if population should get smaller.
Exceptions
ExceptionCondition
ArgumentExceptionToo small population's size was specified. The exception is thrown in the case if newPopulationSize is smaller than 2.
Remarks

The method does resizing of population. In the case if population should grow, it just adds missing number of random members. In the case if population should get smaller, the specified selection method is used to reduce the population.

See Also