Class Minimize

java.lang.Object
org.moeaframework.core.objective.AbstractObjective
org.moeaframework.core.objective.Minimize
All Implemented Interfaces:
Serializable, Comparable<Objective>, Copyable<Objective>, Defined, Named, Objective
Direct Known Subclasses:
NormalizedObjective

public class Minimize extends AbstractObjective
A minimized objective.
See Also:
  • Constructor Details

    • Minimize

      public Minimize()
      Constructs a new, anonymous minimized objective.
    • Minimize

      public Minimize(String name)
      Constructs a new minimized objective.
      Parameters:
      name - the objective name
    • Minimize

      protected Minimize(String name, double value)
      Constructs a new minimized objective.
      Parameters:
      name - the objective name
      value - 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 maximizing f(x).

      Returns:
      the canonical value
    • compareTo

      public int compareTo(double value)
      Description copied from interface: Objective
      Similar to Comparable.compareTo(Object), compares this objective to a given value.
      Parameters:
      value - the value
      Returns:
      -1, 0, or 1 depending if this objective is less than, equal to, or greater than the given value
    • copy

      public Minimize copy()
      Description copied from interface: Copyable
      Creates and returns a copy of this object. It is required that x.copy() is completely independent from x. This means any method invoked on x.copy() in no way alters the state of x and vice versa. It is typically the case that x.copy().getClass() == x.getClass() and x.copy().equals(x).
      Returns:
      the copy
    • normalize

      public NormalizedObjective normalize(double minimum, double maximum)
      Description copied from interface: Objective
      Returns a normalized objective that is:
      1. scaled between the minimum and maximum bounds, typically producing a value falling between [0, 1], and
      2. has an ideal or target value of Double#NEGATIVE_INFINITY.
      Parameters:
      minimum - the minimum bound
      maximum - the maximum bound
      Returns:
      the normalized objective
    • 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

      public static Minimize value()
      Constructs a new, anonymous minimized objective.
      Returns:
      the objective
    • value

      public static Minimize value(String name)
      Constructs a new minimized objective.
      Parameters:
      name - the objective name
      Returns:
      the objective