src/GenFx.Components/Metrics/FitnessStandardDeviation.cs
/// <summary>
/// Calculates the standard deviation of the values of the <see cref="GeneticEntity.ScaledFitnessValue"/> 
/// property in the <paramref name="population"/>.
/// </summary>
/// <param name="population"><see cref="Population"/> from which to derive the metric.</param>
/// <returns>Standard deviation of the values of the <see cref="GeneticEntity.ScaledFitnessValue"/> property.</returns>
/// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
Calculates the standard deviation of the values of the
property in the .
Calculates the standard deviation of the values of the property in the .
public override object? GetResultValue(Population population)
        {
            if (population == null)
            {
                throw new ArgumentNullException(nameof(population));
            }
            this.AssertIsInitialized();
            if (this.Algorithm!.FitnessScalingStrategy == null)
            {
                return population.RawStandardDeviation;
            }
            MeanFitness meanFitness = this.Algorithm.Metrics.OfType<MeanFitness>().First();
            return MathHelper.GetStandardDeviation(
                population.Entities,
                (double)meanFitness.GetResults(population.Index).Last().ResultValue,
                FitnessType.Scaled);
        }
public override object ? GetResultValue ( Population population ) { if ( population == null ) { throw new ArgumentNullException ( nameof ( population ) ) ; } this . AssertIsInitialized ( ) ; if ( this . Algorithm ! . FitnessScalingStrategy == null ) { return population . RawStandardDeviation ; } MeanFitness meanFitness = this . Algorithm . Metrics . OfType < MeanFitness > ( ) . First ( ) ; return MathHelper . GetStandardDeviation ( population . Entities , ( double ) meanFitness . GetResults ( population . Index ) . Last ( ) . ResultValue , FitnessType . Scaled ) ; }
Calculates the standard deviation of the values of the
property in the .
Calculates the standard deviation of the values of the property in the .
// If there's no fitness scaling, just use the raw max value.
Standard deviation of the values of the  property.
Standard deviation of the values of the property .
None
population
Population
from which to derive the metric.
from which to derive the metric .