Class: FeldtRuby::Optimize::Archive::WeirdoTopList
- Inherits:
-
GlobalTopList
- Object
- GlobalTopList
- FeldtRuby::Optimize::Archive::WeirdoTopList
- Defined in:
- lib/feldtruby/optimize/archive.rb
Instance Method Summary collapse
- #data_to_json_hash ⇒ Object
-
#initialize(maxSize, diversityObjective, qualityObjective) ⇒ WeirdoTopList
constructor
A new instance of WeirdoTopList.
Methods inherited from GlobalTopList
#[], #add, #delete_candidates, #each, #inspect, #is_better_than?, #length, #sort_top_list, #to_json
Constructor Details
#initialize(maxSize, diversityObjective, qualityObjective) ⇒ WeirdoTopList
Returns a new instance of WeirdoTopList.
208 209 210 211 |
# File 'lib/feldtruby/optimize/archive.rb', line 208 def initialize(maxSize, diversityObjective, qualityObjective) super(maxSize, diversityObjective) @quality_objective = qualityObjective end |
Instance Method Details
#data_to_json_hash ⇒ Object
213 214 215 216 217 218 219 220 |
# File 'lib/feldtruby/optimize/archive.rb', line 213 def data_to_json_hash h = super() # Since the diversity objective is used to sort the weirdos their # 'quality_values' are actually the diversity quality values. h['diversity_quality_values'] = h['quality_values'] h['quality_values'] = @top_list.map {|c| @quality_objective.quality_of(c)} h end |