src/GenFx.Components/Scaling/SigmaScalingStrategy.cs
/// <summary>
/// Sets the <see cref="GeneticEntity.ScaledFitnessValue"/> property of each entity
/// in the <paramref name="population"/> according to the sigma scaling algorithm.
/// </summary>
/// <param name="population"><see cref="Population"/> containing the <see cref="GeneticEntity"/> objects.</param>
/// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
/// <exception cref="ArgumentException"><paramref name="population"/> does not have its raw mean value set.</exception>
/// <exception cref="ArgumentException"><paramref name="population"/> does not have its raw standard deviation value set.</exception>
Sets the  property of each entity
in the  according to the sigma scaling algorithm.
Sets the property of each entity in the according to the sigma scaling algorithm .
protected override void UpdateScaledFitnessValues(Population population)
        {
            if (population == null)
            {
                throw new ArgumentNullException(nameof(population));
            }
            if (!population.RawMean.HasValue)
            {
                throw new ArgumentException(Resources.PopulationRawMeanNotSet, nameof(population));
            }
            if (!population.RawStandardDeviation.HasValue)
            {
                throw new ArgumentException(Resources.PopulationRawStandardDeviationNotSet, nameof(population));
            }
            foreach (GeneticEntity geneticEntity in population.Entities)
            {
                double scaledFitness = this.GetSigmaScaleValue(geneticEntity, population.RawMean.Value, population.RawStandardDeviation.Value);
                geneticEntity.ScaledFitnessValue = scaledFitness;
            }
        }
protected override void UpdateScaledFitnessValues ( Population population ) { if ( population == null ) { throw new ArgumentNullException ( nameof ( population ) ) ; } if ( ! population . RawMean . HasValue ) { throw new ArgumentException ( Resources . PopulationRawMeanNotSet , nameof ( population ) ) ; } if ( ! population . RawStandardDeviation . HasValue ) { throw new ArgumentException ( Resources . PopulationRawStandardDeviationNotSet , nameof ( population ) ) ; } foreach ( GeneticEntity geneticEntity in population . Entities ) { double scaledFitness = this . GetSigmaScaleValue ( geneticEntity , population . RawMean . Value , population . RawStandardDeviation . Value ) ; geneticEntity . ScaledFitnessValue = scaledFitness ; } }
Sets the  property of each entity
in the  according to the sigma scaling algorithm.
Sets the property of each entity in the according to the sigma scaling algorithm .
None
does not have its raw mean value set.
does not have its raw mean value set .
does not have its raw standard deviation value set.
does not have its raw standard deviation value set .
population
Population
containing the  objects.
containing the objects .