Click or drag to resize
Accord.NET (logo)

PopulationResize Method (Int32)

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
)
Request Example View Source

Parameters

newPopulationSize
Type: SystemInt32
New size of population.
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 population's selection method is used to reduce the population.

See Also