src/GenFx.Components/Metrics/MeanTreeSize.cs
/// <summary>
/// Calculates the mean of the tree size of <see cref="TreeEntityBase"/> objects contained by the
/// <paramref name="population"/>.
/// </summary>
/// <param name="population"><see cref="Population"/> from which to derive the metric.</param>
/// <returns>Mean of the tree size of the <see cref="TreeEntityBase"/> objects.</returns>
/// <exception cref="ArgumentNullException"><paramref name="population"/> is null.</exception>
Calculates the mean of the tree size of  objects contained by the
.
Calculates the mean of the tree size of objects contained by the .
public override object GetResultValue(Population population)
        {
            if (population == null)
            {
                throw new ArgumentNullException(nameof(population));
            }
            int sum = 0;
            for (int i = 0; i < population.Entities.Count; i++)
            {
                TreeEntityBase tree = (TreeEntityBase)population.Entities[i];
                sum += tree.GetSize();
            }
            return (double)sum / population.Entities.Count;
        }
public override object GetResultValue ( Population population ) { if ( population == null ) { throw new ArgumentNullException ( nameof ( population ) ) ; } int sum = 0 ; for ( int i = 0 ; i < population . Entities . Count ; i ++ ) { TreeEntityBase tree = ( TreeEntityBase ) population . Entities [ i ] ; sum += tree . GetSize ( ) ; } return ( double ) sum / population . Entities . Count ; }
Calculates the mean of the tree size of  objects contained by the
.
Calculates the mean of the tree size of objects contained by the .
Mean of the tree size of the  objects.
Mean of the tree size of the objects .
None
population
Population
from which to derive the metric.
from which to derive the metric .