src/GenFx/MathHelper.cs
/// <summary>
/// Returns the standard deviation of the raw fitness value for the <paramref name="entities"/>.
/// </summary>
/// <param name="entities">The entities whose fitness values should be used.</param>
/// <param name="mean">Mean fitness value for the population.</param>
/// <param name="fitnessType">The type of fitness value to use.</param>
/// <returns>The standard deviation of the raw fitness value for the population.</returns>
Returns the standard deviation of the raw fitness value for the .
Returns the standard deviation of the raw fitness value for the .
public static double GetStandardDeviation(IEnumerable<GeneticEntity> entities, double mean, FitnessType fitnessType)
        {
            int count = 0;
            double diffSums = entities.Sum(e =>
            {
                count++;
                double val;
                if (fitnessType == FitnessType.Scaled)
                {
                    val = e.ScaledFitnessValue - mean;
                }
                else
                {
                    val = e.RawFitnessValue - mean;
                }
                return Math.Pow(val, 2);
            });
            return Math.Sqrt(diffSums / count);
        }
public static double GetStandardDeviation ( IEnumerable < GeneticEntity > entities , double mean , FitnessType fitnessType ) { int count = 0 ; double diffSums = entities . Sum ( e => { count ++ ; double val ; if ( fitnessType == FitnessType . Scaled ) { val = e . ScaledFitnessValue - mean ; } else { val = e . RawFitnessValue - mean ; } return Math . Pow ( val , 2 ) ; } ) ; return Math . Sqrt ( diffSums / count ) ; }
Returns the standard deviation of the raw fitness value for the .
Returns the standard deviation of the raw fitness value for the .
The standard deviation of the raw fitness value for the population.
The standard deviation of the raw fitness value for the population .
entities
IEnumerable<GeneticEntity>
The entities whose fitness values should be used.
The entities whose fitness values should be used .
mean
double
Mean fitness value for the population.
Mean fitness value for the population .
fitnessType
FitnessType
The type of fitness value to use.
The type of fitness value to use .