src/GenFx/GeneticAlgorithm.cs
/// <summary>
/// Helper method used to apply the <see cref="GenFx.ElitismStrategy"/>, if one is set, to the <paramref name="currentPopulation"/>.
/// </summary>
/// <param name="currentPopulation"><see cref="Population"/> from which to select the
/// elite entities.</param>
/// <returns>The collection of entities, if any, that are elite.</returns>
/// <exception cref="ArgumentNullException"><paramref name="currentPopulation"/> is null.</exception>
Helper method used to apply the , if one is set, to the .
Helper method used to apply the if one is set to the .
protected IList<GeneticEntity> ApplyElitism(Population currentPopulation)
        {
            if (currentPopulation == null)
            {
                throw new ArgumentNullException(nameof(currentPopulation));
            }
            if (this.ElitismStrategy != null)
            {
                return this.ElitismStrategy.GetEliteEntities(currentPopulation);
            }
            else
            {
                return new List<GeneticEntity>();
            }
        }
protected IList < GeneticEntity > ApplyElitism ( Population currentPopulation ) { if ( currentPopulation == null ) { throw new ArgumentNullException ( nameof ( currentPopulation ) ) ; } if ( this . ElitismStrategy != null ) { return this . ElitismStrategy . GetEliteEntities ( currentPopulation ) ; } else { return new List < GeneticEntity > ( ) ; } }
Helper method used to apply the , if one is set, to the .
Helper method used to apply the if one is set to the .
The collection of entities, if any, that are elite.
The collection of entities if any that are elite .
None
currentPopulation
Population
from which to select the
elite entities.
from which to select the elite entities .