Class: FeldtRuby::Optimize::Objective::WeightedSumAggregator

Inherits:
QualityAggregator show all
Defined in:
lib/feldtruby/optimize/objective.rb

Overview

A WeightedSumAggregator sums individual quality values, each multiplied with a weight.

Direct Known Subclasses

MeanWeigthedGlobalRatios

Instance Attribute Summary

Attributes inherited from QualityAggregator

#objective

Instance Method Summary collapse

Methods inherited from QualityAggregator

#make_quality_value

Instance Method Details

#aggregate_from_sub_qualities(subQualityValues, weights) ⇒ Object



359
360
361
362
363
364
365
# File 'lib/feldtruby/optimize/objective.rb', line 359

def aggregate_from_sub_qualities subQualityValues, weights
  sum = 0.0
  subQualityValues.each_with_index do |qv, i|
    sum += (qv * weights[i] * @signs[i])
  end
  sum
end