|
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
)
Public Sub Resize (
newPopulationSize As Integer,
membersSelector As ISelectionMethod
)
Request Example
View SourceParameters
- newPopulationSize
- Type: SystemInt32
New size of population. - membersSelector
- Type: Accord.GeneticISelectionMethod
Selection algorithm to use in the case
if population should get smaller.
Exceptions Exception | Condition |
---|
ArgumentException | Too 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