src/GenFx.Components/SelectionOperators/RouletteWheelSampler.cs
/// <summary>
/// Spins the roulette wheel to return a <see cref="GeneticEntity"/>.
/// </summary>
Spins the roulette wheel to return a .
Spins the roulette wheel to return a .
private static GeneticEntity SpinWheel(List<EntityPercentageRange> percentageRanges)
        {
            double percentTarget = RandomNumberService.Instance.GetDouble() * 100;
            return percentageRanges
                .Where(r => (percentTarget >= r.MinValue && percentTarget < r.MaxValue) || 100 == percentTarget && percentTarget == r.MaxValue)
                .Select(r => r.Entity)
                .FirstOrDefault();
        }
private static GeneticEntity SpinWheel ( List < EntityPercentageRange > percentageRanges ) { double percentTarget = RandomNumberService . Instance . GetDouble ( ) * 100 ; return percentageRanges . Where ( r => ( percentTarget >= r . MinValue && percentTarget < r . MaxValue ) || 100 == percentTarget && percentTarget == r . MaxValue ) . Select ( r => r . Entity ) . FirstOrDefault ( ) ; }
Spins the roulette wheel to return a .
Spins the roulette wheel to return a .
percentageRanges
List<EntityPercentageRange>