src/GenFx/SelectionOperator.cs
/// <summary>
/// Selects the specified number of <see cref="GeneticEntity"/> objects from <paramref name="population"/>.
/// </summary>
/// <param name="entityCount">Number of <see cref="GeneticEntity"/> objects to select from the population.</param>
/// <param name="population"><see cref="Population"/> containing the <see cref="GeneticEntity"/> objects from which to select.
/// objects from which to select.</param>
/// <returns>The <see cref="GeneticEntity"/> object that was selected.</returns>
/// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="population"/> does not contain any entities.</exception>
Selects the specified number of  objects from .
Selects the specified number of objects from .
public IList<GeneticEntity> SelectEntities(int entityCount, Population population)
        {
            if (population == null)
            {
                throw new ArgumentNullException(nameof(population));
            }
            if (population.Entities.Count == 0)
            {
                throw new ArgumentException(
                  StringUtil.GetFormattedString(Resources.ErrorMsg_EntityListEmpty), nameof(population));
            }
            IEnumerable<GeneticEntity> result = this.SelectEntitiesFromPopulation(entityCount, population);
            if (result == null)
            {
                throw new InvalidOperationException(
                    StringUtil.GetFormattedString(Resources.ErrorMsg_NullReturnValue, this.GetType(), nameof(SelectEntitiesFromPopulation)));
            }
            return result.ToList();
        }
public IList < GeneticEntity > SelectEntities ( int entityCount , Population population ) { if ( population == null ) { throw new ArgumentNullException ( nameof ( population ) ) ; } if ( population . Entities . Count == 0 ) { throw new ArgumentException ( StringUtil . GetFormattedString ( Resources . ErrorMsg_EntityListEmpty ) , nameof ( population ) ) ; } IEnumerable < GeneticEntity > result = this . SelectEntitiesFromPopulation ( entityCount , population ) ; if ( result == null ) { throw new InvalidOperationException ( StringUtil . GetFormattedString ( Resources . ErrorMsg_NullReturnValue , this . GetType ( ) , nameof ( SelectEntitiesFromPopulation ) ) ) ; } return result . ToList ( ) ; }
Selects the specified number of  objects from .
Selects the specified number of objects from .
The  object that was selected.
The object that was selected .
None
does not contain any entities.
does not contain any entities .
entityCount
int
Number of  objects to select from the population.
Number of objects to select from the population .
population
Population
containing the  objects from which to select.
objects from which to select.
containing the objects from which to select . objects from which to select .