Package org.ojalgo.optimisation
Enum Optimisation.State
- java.lang.Object
-
- java.lang.Enum<Optimisation.State>
-
- org.ojalgo.optimisation.Optimisation.State
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Optimisation.State>
,Optimisation
- Enclosing interface:
- Optimisation
public static enum Optimisation.State extends java.lang.Enum<Optimisation.State> implements Optimisation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M extends Optimisation.Model,S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.ProblemStructure, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPROXIMATE
Approximate and/or Intermediate solution - Iteration point Probably infeasible, but still "good"DISTINCT
Unique (and optimal) solution - there is no other solution that is equal or betterFAILED
Unexpected failure or exceptionFEASIBLE
Solved - a solution that complies with all constraintsINFEASIBLE
No solution that complies with all constraints exists (found).INVALID
The problem/model is infeasible, unbounded or otherwise invalid.OPTIMAL
Optimal solution - there is no betterUNBOUNDED
There's an infinite number of feasible solutions and no bound on the objective function value.UNEXPLORED
New/changed problemVALID
Model entities and solver components (matrices) are valid
-
Field Summary
Fields Modifier and Type Field Description private int
myValue
-
Constructor Summary
Constructors Modifier Constructor Description private
State(int aValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
absValue()
boolean
isApproximate()
boolean
isDistinct()
boolean
isFailure()
FAILED, INVALID, INFEASIBLE or UNBOUNDEDboolean
isFeasible()
boolean
isOptimal()
boolean
isSuccess()
VALID, APPROXIMATE, FEASIBLE, OPTIMAL or DISTINCTboolean
isUnexplored()
UNEXPLOREDboolean
isValid()
static Optimisation.State
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Optimisation.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
APPROXIMATE
public static final Optimisation.State APPROXIMATE
Approximate and/or Intermediate solution - Iteration point Probably infeasible, but still "good"
-
DISTINCT
public static final Optimisation.State DISTINCT
Unique (and optimal) solution - there is no other solution that is equal or better
-
FAILED
public static final Optimisation.State FAILED
Unexpected failure or exception
-
FEASIBLE
public static final Optimisation.State FEASIBLE
Solved - a solution that complies with all constraints
-
INFEASIBLE
public static final Optimisation.State INFEASIBLE
No solution that complies with all constraints exists (found).In practise this often means "infeasible or unbounded". The key thing is that with this state the returned solution is not (known to be) feasible.
-
INVALID
public static final Optimisation.State INVALID
The problem/model is infeasible, unbounded or otherwise invalid.
-
OPTIMAL
public static final Optimisation.State OPTIMAL
Optimal solution - there is no better
-
UNBOUNDED
public static final Optimisation.State UNBOUNDED
There's an infinite number of feasible solutions and no bound on the objective function value.Note that using this state indicator implies a feasible solution! This is not in line with how many other optimisation tools interpret "unbounded".
If a feasible solution has not been found, the correct state indicator to use is
INFEASIBLE
or possiblyINVALID
, #FAILED} orAPPROXIMATE
.If a problem is concluded to be unbounded but a feasible solution has been found, it may still be preferable to us
FEASIBLE
rather thanUNBOUNDED
.There is, unfortunately, no way to convey that a problem is proven to be unbounded without a feasible solution.
-
UNEXPLORED
public static final Optimisation.State UNEXPLORED
New/changed problem
-
VALID
public static final Optimisation.State VALID
Model entities and solver components (matrices) are valid
-
-
Method Detail
-
values
public static Optimisation.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Optimisation.State c : Optimisation.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Optimisation.State valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isApproximate
public boolean isApproximate()
-
isDistinct
public boolean isDistinct()
-
isFailure
public boolean isFailure()
FAILED, INVALID, INFEASIBLE or UNBOUNDED
-
isFeasible
public boolean isFeasible()
-
isOptimal
public boolean isOptimal()
-
isSuccess
public boolean isSuccess()
VALID, APPROXIMATE, FEASIBLE, OPTIMAL or DISTINCT
-
isUnexplored
public boolean isUnexplored()
UNEXPLORED
-
isValid
public boolean isValid()
-
absValue
private int absValue()
-
-