src/GenFx.Components/Metrics/MeanFitness.cs
/// <summary>
/// Calculates the mean 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>Mean of the values of the <see cref="GeneticEntity.ScaledFitnessValue"/> property.</returns>
/// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
Calculates the mean of the values of the
property in the .
Calculates the mean 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.RawMean;
            }
            double scaledSum = population.Entities.Sum(e => e.ScaledFitnessValue);
            return scaledSum / population.Entities.Count;
        }
public override object ? GetResultValue ( Population population ) { if ( population == null ) { throw new ArgumentNullException ( nameof ( population ) ) ; } this . AssertIsInitialized ( ) ; if ( this . Algorithm ! . FitnessScalingStrategy == null ) { return population . RawMean ; } double scaledSum = population . Entities . Sum ( e => e . ScaledFitnessValue ) ; return scaledSum / population . Entities . Count ; }
Calculates the mean of the values of the
property in the .
Calculates the mean of the values of the property in the .
// If there's no fitness scaling, just use the raw mean value.
Mean of the values of the  property.
Mean of the values of the property .
None
population
Population
from which to derive the metric.
from which to derive the metric .