Package org.moeaframework.core.objective
Class Maximize
java.lang.Object
org.moeaframework.core.objective.AbstractObjective
org.moeaframework.core.objective.Maximize
- All Implemented Interfaces:
Serializable
,Comparable<Objective>
,Copyable<Objective>
,Defined
,Named
,Objective
A maximized objective.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.moeaframework.core.Defined
Defined.ConstructorComparator
-
Field Summary
Fields inherited from class org.moeaframework.core.objective.AbstractObjective
name, value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(double value) Similar toComparable.compareTo(Object)
, compares this objective to a given value.copy()
Creates and returns a copy of this object.double
Returns the canonical value of this objective.double
Returns the ideal or best possible value for this objective.normalize
(double minimum, double maximum) Returns a normalized objective that is: scaled between the minimum and maximum bounds, typically producing a value falling between[0, 1]
, and has an ideal or target value ofDouble#NEGATIVE_INFINITY
.static Maximize
value()
Constructs a new, anonymous maximized objective.static Maximize
Constructs a new maximized objective.Methods inherited from class org.moeaframework.core.objective.AbstractObjective
equals, getDefinition, getName, getValue, hashCode, setValue, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.moeaframework.core.objective.Objective
applyWeight, compareTo, distanceTo, distanceTo, getEpsilonDistance, getEpsilonIndex, withValue
-
Constructor Details
-
Maximize
public Maximize()Constructs a new, anonymous maximized objective. -
Maximize
Constructs a new maximized objective.- Parameters:
name
- the objective name
-
Maximize
Constructs a new maximized objective.- Parameters:
name
- the objective namevalue
- the objective value
-
-
Method Details
-
getCanonicalValue
public double getCanonicalValue()Description copied from interface:Objective
Returns the canonical value of this objective.The canonical value is the objective converted into a minimized form, with the target or ideal towards -1d/0d. This allows an implementation to use the numeric value of the objective directly, without needing to be aware of the optimization direction. This works since minimizing
-f(x)
is equivalent to maximizingf(x)
.- Returns:
- the canonical value
-
compareTo
public int compareTo(double value) Description copied from interface:Objective
Similar toComparable.compareTo(Object)
, compares this objective to a given value.- Parameters:
value
- the value- Returns:
-1
,0
, or1
depending if this objective is less than, equal to, or greater than the given value
-
copy
Description copied from interface:Copyable
Creates and returns a copy of this object. It is required thatx.copy()
is completely independent fromx
. This means any method invoked onx.copy()
in no way alters the state ofx
and vice versa. It is typically the case thatx.copy().getClass() == x.getClass()
andx.copy().equals(x)
.- Returns:
- the copy
-
normalize
Description copied from interface:Objective
Returns a normalized objective that is:- scaled between the minimum and maximum bounds, typically producing a value falling between
[0, 1]
, and - has an ideal or target value of
Double#NEGATIVE_INFINITY
.
- Parameters:
minimum
- the minimum boundmaximum
- the maximum bound- Returns:
- the normalized objective
- scaled between the minimum and maximum bounds, typically producing a value falling between
-
getIdealValue
public double getIdealValue()Description copied from interface:Objective
Returns the ideal or best possible value for this objective.- Returns:
- the ideal objective value
-
value
Constructs a new, anonymous maximized objective.- Returns:
- the objective
-
value
Constructs a new maximized objective.- Parameters:
name
- the objective name- Returns:
- the objective
-