/// <summary> /// Returns the measured value regarding the given characteristic averaged across all datapoints corresponding to this service unit and the current group indicated by the supplied filter function. /// </summary> /// <param name="entry">The characteristic to look up.</param> /// <param name="datapointFilter">A function filtering for the datapoints of the current group.</param> /// <returns>The value measured for the characteristic (average across corresponding datapoints).</returns> public double GetValue(FootprintDatapoint.FootPrintEntry entry, Func <FootprintDatapoint, bool> datapointFilter) { return(_datapoints.Where(d => datapointFilter(d)).Average(d => Convert.ToDouble(d[entry]))); }
/// <summary> /// Returns the measured value regarding the given characteristic averaged across all datapoints corresponding to this service unit. /// </summary> /// <param name="entry">The characteristic to look up.</param> /// <returns>The value measured for the characteristic (average across corresponding datapoints).</returns> public double this[FootprintDatapoint.FootPrintEntry entry] { get { return(_datapoints.Average(d => (double)d[entry])); } }