Class: FeldtRuby::Optimize::Objective::WeightedSumAggregator
- Inherits:
-
QualityAggregator
- Object
- QualityAggregator
- FeldtRuby::Optimize::Objective::WeightedSumAggregator
- Defined in:
- lib/feldtruby/optimize/objective.rb
Overview
A WeightedSumAggregator sums individual quality values, each multiplied with a weight.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from QualityAggregator
Instance Method Summary collapse
Methods inherited from QualityAggregator
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 |