Package es.urjc.etsii.grafo.algorithms
Enum Class FMode
- All Implemented Interfaces:
Serializable
,Comparable<FMode>
,Constable
Solving mode, can be either maximize or minimize
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract double
best
(double a, double b) Get the best value between two valuesabstract double
Get a really bad value for this mode, so any other value is better than this one.abstract boolean
improves
(double a) Check if score improvesabstract boolean
isBetter
(double a, double b) Compare two scoresabstract boolean
isBetterOrEqual
(double a, double b) Compare two scoresstatic FMode
Returns the enum constant of this class with the specified name.static FMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAXIMIZE
Objective function should be maximized -
MINIMIZE
Objective function should be minimized
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
best
public abstract double best(double a, double b) Get the best value between two values- Parameters:
a
- valueb
- 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
- scoreb
- 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
- scoreb
- 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
-