Class: FeldtRuby::Optimize::PercentageQualityValue

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

Instance Attribute Summary

Attributes inherited from QualityValue

#candidate, #objective, #sub_qualities

Instance Method Summary collapse

Methods inherited from QualityValue

#<=>, #initialize, #sub_quality, #to_s, #value

Constructor Details

This class inherits a constructor from FeldtRuby::Optimize::QualityValue

Instance Method Details

#display_valueObject



494
495
496
# File 'lib/feldtruby/optimize/objective.rb', line 494

def display_value
  (1.0 - value) * 100.0
end

#value_to_sObject



497
498
499
500
# File 'lib/feldtruby/optimize/objective.rb', line 497

def value_to_s
  return "N/A" if @sub_qualities.any? {|sq| sq.nil?}
  "%s%%" % display_value.to_significant_digits(6).to_s
end