Enum Class FMode

java.lang.Object
java.lang.Enum<FMode>
es.urjc.etsii.grafo.algorithms.FMode
All Implemented Interfaces:
Serializable, Comparable<FMode>, Constable

public enum FMode extends Enum<FMode>
Solving mode, can be either maximize or minimize
  • Enum Constant Details

    • MAXIMIZE

      public static final FMode MAXIMIZE
      Objective function should be maximized
    • MINIMIZE

      public static final FMode MINIMIZE
      Objective function should be minimized
  • Method Details

    • values

      public static FMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • best

      public abstract double best(double a, double b)
      Get the best value between two values
      Parameters:
      a - value
      b - value
      Returns:
      the best value between a and b
    • getBadValue

      public abstract double getBadValue()
      Get a really bad value for this mode, so any other value is better than this one. Useful for example for giving an initial value to the "bestValue" variable when looping through solutions
      Returns:
      a really big value if minimizing, a negative number if maximizing.
    • isBetter

      public abstract boolean isBetter(double a, double b)
      Compare two scores
      Parameters:
      a - score
      b - score
      Returns:
      true if the score a is better than score b
    • isBetterOrEqual

      public abstract boolean isBetterOrEqual(double a, double b)
      Compare two scores
      Parameters:
      a - score
      b - score
      Returns:
      true if the score a is better or equal than score b
    • improves

      public abstract boolean improves(double a)
      Check if score improves
      Parameters:
      a - score to check
      Returns:
      true if score improves the solution, false otherwise