Package org.moeaframework.core.objective
Class NormalizedObjective
java.lang.Object
org.moeaframework.core.objective.AbstractObjective
org.moeaframework.core.objective.Minimize
org.moeaframework.core.objective.NormalizedObjective
- All Implemented Interfaces:
Serializable
,Comparable<Objective>
,Copyable<Objective>
,Defined
,Named
,Objective
A normalized objective. By convention, normalized objectives are minimized. This implementation is distinct from
Minimize
since some methods are either redundant or unsupported on a normalized objective. Such methods
will throw a UnsupportedOperationException
if used.- 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
ConstructorDescriptionNormalizedObjective
(String name) Constructs a new normalized objective.NormalizedObjective
(String name, double value) Constructs a new normalized objective. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates and returns a copy of this object.double
getEpsilonDistance
(double epsilon) This method is not supported for normalized objectives.int
getEpsilonIndex
(double epsilon) This method is not supported for normalized objectives.normalize
(double minimum, double maximum) This method is not supported for normalized objectives.Methods inherited from class org.moeaframework.core.objective.Minimize
compareTo, getCanonicalValue, getIdealValue, value, value
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, withValue
-
Constructor Details
-
NormalizedObjective
Constructs a new normalized objective.- Parameters:
name
- the objective name
-
NormalizedObjective
Constructs a new normalized objective.- Parameters:
name
- the objective namevalue
- the objective value
-
-
Method Details
-
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)
. -
normalize
This method is not supported for normalized objectives.- Specified by:
normalize
in interfaceObjective
- Overrides:
normalize
in classMinimize
- Parameters:
minimum
- the minimum boundmaximum
- the maximum bound- Returns:
- the normalized objective
- Throws:
UnsupportedOperationException
- as this operation is not permitted on normalized objectives
-
getEpsilonIndex
public int getEpsilonIndex(double epsilon) This method is not supported for normalized objectives.- Parameters:
epsilon
- the epsilon value- Returns:
- the index
- Throws:
UnsupportedOperationException
- as this operation is not permitted on normalized objectives
-
getEpsilonDistance
public double getEpsilonDistance(double epsilon) This method is not supported for normalized objectives.- Parameters:
epsilon
- the epsilon value- Returns:
- the distance
- Throws:
UnsupportedOperationException
- as this operation is not permitted on normalized objectives
-