Module: Moea::WeakPareto
- Includes:
- Pareto
- Defined in:
- ../lib/pareto.rb
Overview
The Weak Pareto optimality support. It offers the same functionality as the Pareto module, with the different dominates? method.
Instance Method Summary (collapse)
-
- (Object) <=>(other)
a<=>b returns: .
-
- (Boolean) dominates?(other)
Given that a and b are individuals of the same class, a.dominates?(b) returns true if there is no such objective in which the b is better than a.
Methods included from Pareto
clear_objectives, dominated, maximize, minimize, nondominated, objective, objective_best, objective_sort, objective_symbols, #objective_symbols
Instance Method Details
- (Object) <=>(other)
a<=>b returns:
-1 if a dominates b and b does not dominate a,
1 if b dominates a and a does not dominate b,
0 otherwise.
239 240 241 242 243 244 245 246 247 |
# File '../lib/pareto.rb', line 239 def <=>(other) if dominates? other return 0 if other.dominates? self return -1 else return 1 if other.dominates? self return 0 end end |
- (Boolean) dominates?(other)
Given that a and b are individuals of the same class, a.dominates?(b) returns true if there is no such objective in which the b is better than a.
231 232 233 |
# File '../lib/pareto.rb', line 231 def dominates? other dominates_core( other, true ) end |