Class: FeldtRuby::Optimize::MaxStepsTerminationCriterion
- Inherits:
-
TerminationCriterion
- Object
- TerminationCriterion
- FeldtRuby::Optimize::MaxStepsTerminationCriterion
- Defined in:
- lib/feldtruby/optimize/max_steps_termination_criterion.rb
Instance Attribute Summary collapse
-
#max_steps ⇒ Object
Returns the value of attribute max_steps.
Instance Method Summary collapse
-
#initialize(maxSteps = 10_000) ⇒ MaxStepsTerminationCriterion
constructor
A new instance of MaxStepsTerminationCriterion.
- #terminate?(optimizer) ⇒ Boolean
Methods inherited from TerminationCriterion
Constructor Details
#initialize(maxSteps = 10_000) ⇒ MaxStepsTerminationCriterion
Returns a new instance of MaxStepsTerminationCriterion.
18 19 20 |
# File 'lib/feldtruby/optimize/max_steps_termination_criterion.rb', line 18 def initialize(maxSteps = 10_000) @max_steps = maxSteps end |
Instance Attribute Details
#max_steps ⇒ Object
Returns the value of attribute max_steps.
16 17 18 |
# File 'lib/feldtruby/optimize/max_steps_termination_criterion.rb', line 16 def max_steps @max_steps end |
Instance Method Details
#terminate?(optimizer) ⇒ Boolean
21 22 23 |
# File 'lib/feldtruby/optimize/max_steps_termination_criterion.rb', line 21 def terminate?(optimizer) optimizer.num_optimization_steps >= @max_steps end |