Class: Evolvable::MinimizeGoal
- Defined in:
- lib/evolvable/minimize_goal.rb
Overview
Prioritizes instances with lesser values.
The default goal value is -Float::INFINITY
, but it can be reassigned
to any numeric value
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Goal
Constructor Details
This class inherits a constructor from Evolvable::Goal
Instance Method Details
#evaluate(evolvable) ⇒ Object
14 15 16 |
# File 'lib/evolvable/minimize_goal.rb', line 14 def evaluate(evolvable) -evolvable.value end |
#met?(evolvable) ⇒ Boolean
18 19 20 |
# File 'lib/evolvable/minimize_goal.rb', line 18 def met?(evolvable) evolvable.value <= value end |
#value ⇒ Object
10 11 12 |
# File 'lib/evolvable/minimize_goal.rb', line 10 def value @value ||= -Float::INFINITY end |