Class: MinEasom
- Inherits:
-
Min2DSingleObjectiveFunc
- Object
- FeldtRuby::Optimize::Objective
- MinContinousFunction
- MinSingleObjectiveFunc
- Min2DSingleObjectiveFunc
- MinEasom
- Defined in:
- lib/feldtruby/optimize/problems/single_objective_problems.rb
Overview
This is Easom’s function as stated on the page:
http://en.wikipedia.org/wiki/Test_functions_for_optimization
Constant Summary collapse
- PI =
Math::PI
Instance Attribute Summary
Attributes inherited from FeldtRuby::Optimize::Objective
#best_candidate, #current_version, #global_max_values_per_goal, #global_min_values_per_goal
Attributes included from FeldtRuby::Logging
Instance Method Summary collapse
- #calc_func(candidate) ⇒ Object
- #domain_per_dimension ⇒ Object
- #min_solutions ⇒ Object
- #minimum ⇒ Object
Methods inherited from Min2DSingleObjectiveFunc
Methods inherited from MinSingleObjectiveFunc
Methods inherited from MinContinousFunction
#dimensions, #domain_as_mins_maxs, #search_space
Methods inherited from FeldtRuby::Optimize::Objective
#aggregated_quality, #calculate_sub_qualities_of, #goal_methods, #hat_compare, #initialize, #invalidate_quality_of, #is_better_than?, #is_better_than_for_goal?, #is_goal_method?, #is_min_goal?, #is_min_goal_method?, #map_candidate_to_object_to_be_evaluated, #note_end_of_optimization, #num_goals, #quality_of, #rank_candidates, #sub_qualities_of, #weights, #weights=
Methods included from FeldtRuby::Logging
#__find_logger_set_on_instance_vars, #new_default_logger, #setup_logger_and_distribute_to_instance_variables
Constructor Details
This class inherits a constructor from FeldtRuby::Optimize::Objective
Instance Method Details
#calc_func(candidate) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/feldtruby/optimize/problems/single_objective_problems.rb', line 148 def calc_func(candidate) x, y = candidate[0], candidate[1] f1 = Math.cos(x) f2 = Math.cos(y) x_min_pi = x - PI y_min_pi = y - PI f3 = Math.exp(-(x_min_pi*x_min_pi + y_min_pi*y_min_pi)) (-f1) * f2 * f3 end |
#domain_per_dimension ⇒ Object
144 145 146 |
# File 'lib/feldtruby/optimize/problems/single_objective_problems.rb', line 144 def domain_per_dimension [-100.0, 100.0] end |
#min_solutions ⇒ Object
140 141 142 |
# File 'lib/feldtruby/optimize/problems/single_objective_problems.rb', line 140 def min_solutions [[PI, PI]] end |
#minimum ⇒ Object
134 135 136 |
# File 'lib/feldtruby/optimize/problems/single_objective_problems.rb', line 134 def minimum -1.0 end |