Package org.ojalgo.optimisation
Class Optimisation.Options
- java.lang.Object
-
- org.ojalgo.optimisation.Optimisation.Options
-
- All Implemented Interfaces:
Optimisation
- Enclosing interface:
- Optimisation
public static final class Optimisation.Options extends java.lang.Object 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
-
-
Field Summary
Fields Modifier and Type Field Description boolean
experimental
This may turn on various experimental features.NumberContext
feasibility
Used to determine/validate feasibility.int
iterations_abort
The maximmum number of iterations allowed for the solve() command.int
iterations_suffice
Calculations will be terminated after this number of iterations if a feasible solution has been found.BasicLogger
logger_appender
If this is null nothing is printed, if it is not null then progress/debug messages are printed to that BasicLogger.boolean
logger_detailed
Detailed (debug) logging or not.java.lang.Class<? extends Optimisation.Solver>
logger_solver
Which Optimisation.Solver to debug.private java.lang.Object
myConfigurator
private ConvexSolver.Configuration
myConvexConfiguration
private IntegerStrategy
myIntegerStrategy
private LinearSolver.Configuration
myLinearConfiguration
NumberContext
print
For display only!Object.toString()
and log message formatting.NumberContext
solution
Describes the (required/sufficient) accuracy of the solution.java.lang.Boolean
sparse
Controls if sparse/iterative solvers should be favoured over dense/direct alternatives.long
time_abort
The maximmum number of millis allowed for the solve() command.long
time_suffice
Calculations will be terminated after this amount of time if a feasible solution has been found.boolean
validate
If true models and solvers will validate data at various points.
-
Constructor Summary
Constructors Constructor Description Options()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optimisation.Options
abort(CalendarDateDuration duration)
ConvexSolver.Configuration
convex()
Configurations specific to ojAlgo's built-inConvexSolver
.Optimisation.Options
convex(ConvexSolver.Configuration configuration)
Optimisation.Options
debug(java.lang.Class<? extends Optimisation.Solver> solver)
Will configure detailed debug logging and validation<T> java.util.Optional<T>
getConfigurator(java.lang.Class<T> type)
IntegerStrategy
integer()
Optimisation.Options
integer(IntegerStrategy strategy)
Set the strategy/configuration for theIntegerSolver
.LinearSolver.Configuration
linear()
Optimisation.Options
linear(LinearSolver.Configuration configuration)
Configurations specific to ojAlgo's built-inLinearSolver
.Optimisation.Options
progress(java.lang.Class<? extends Optimisation.Solver> solver)
Will configure high level (low volume) progress loggingvoid
setConfigurator(java.lang.Object configurator)
A configurator for 3:d party solvers.Optimisation.Options
suffice(CalendarDateDuration duration)
-
-
-
Field Detail
-
experimental
public boolean experimental
This may turn on various experimental features. If you do not know exactly what you want to turn on, for the specific version you're using, then always leave this 'false'.
-
feasibility
public NumberContext feasibility
Used to determine/validate feasibility. Are the variables within their bounds or not, are the constraints violated or not? are the variable values integer or not?Primarily used in
ExpressionsBasedModel
. Not used (should not be) as part of solver logic, but ouside the solvers to validate their results.
-
iterations_abort
public int iterations_abort
The maximmum number of iterations allowed for the solve() command.
-
iterations_suffice
public int iterations_suffice
Calculations will be terminated after this number of iterations if a feasible solution has been found. If no feasible solution has been found calculations will continue until one is found or iterations_abort is reached. This option is, probably, only of interest with the IntegerSolver.
-
logger_appender
public BasicLogger logger_appender
If this is null nothing is printed, if it is not null then progress/debug messages are printed to that BasicLogger.
-
logger_detailed
public boolean logger_detailed
Detailed (debug) logging or not.
-
logger_solver
public java.lang.Class<? extends Optimisation.Solver> logger_solver
Which Optimisation.Solver to debug. Null means NO solvers. This setting is only relevant iflogger_appender
has been set.
-
print
public NumberContext print
For display only!Object.toString()
and log message formatting.
-
solution
public NumberContext solution
Describes the (required/sufficient) accuracy of the solution. It is used when copying the solver's solution back to the model (converting from double to BigDecimal). Specific solvers may also use this as a stopping criteria or similar. The default essentially copies the numbers as is – corresponding to full double precision – but with no more than 14 decimals.
-
sparse
public java.lang.Boolean sparse
Controls if sparse/iterative solvers should be favoured over dense/direct alternatives. Sparse/iterative alternatives are usually preferable with larger models, but there are also algorithmical differences that could make one alternative better than the other for a (your) specific case. There are 3 different possibilities for this option:- TRUE Will use the sparse linear solver and the iterative convex solver.
- FALSE Will use the dense linear solver and the direct convex solver.
- NULL ojAlgo will use some logic to choose for you. This is the default. Currently, the dense LinearSolver and the iterative ConvexSolver will be used. In the vast majority of cases these are the best alternatives.
-
time_abort
public long time_abort
The maximmum number of millis allowed for the solve() command. Executions will be aborted regardless of if a solution has been found or not.
-
time_suffice
public long time_suffice
Calculations will be terminated after this amount of time if a feasible solution has been found. If no feasible solution has been found calculations will continue until one is found or time_abort is reached. This option is , probably, only of interest with the IntegerSolver.
-
validate
public boolean validate
If true models and solvers will validate data at various points. Validation is turned off by default. Turning it on will significantly slow down execution - even very expensive validation may be performed.
-
myConfigurator
private java.lang.Object myConfigurator
-
myConvexConfiguration
private ConvexSolver.Configuration myConvexConfiguration
-
myIntegerStrategy
private IntegerStrategy myIntegerStrategy
-
myLinearConfiguration
private LinearSolver.Configuration myLinearConfiguration
-
-
Method Detail
-
abort
public Optimisation.Options abort(CalendarDateDuration duration)
-
convex
public ConvexSolver.Configuration convex()
Configurations specific to ojAlgo's built-inConvexSolver
.
-
convex
public Optimisation.Options convex(ConvexSolver.Configuration configuration)
-
debug
public Optimisation.Options debug(java.lang.Class<? extends Optimisation.Solver> solver)
Will configure detailed debug logging and validation
-
getConfigurator
public <T> java.util.Optional<T> getConfigurator(java.lang.Class<T> type)
-
integer
public IntegerStrategy integer()
-
integer
public Optimisation.Options integer(IntegerStrategy strategy)
Set the strategy/configuration for theIntegerSolver
. You can either reconfigure theIntegerStrategy.DEFAULT
instance or create an entirely new implementation of the interface.
-
linear
public LinearSolver.Configuration linear()
-
linear
public Optimisation.Options linear(LinearSolver.Configuration configuration)
Configurations specific to ojAlgo's built-inLinearSolver
.
-
progress
public Optimisation.Options progress(java.lang.Class<? extends Optimisation.Solver> solver)
Will configure high level (low volume) progress logging
-
setConfigurator
public void setConfigurator(java.lang.Object configurator)
A configurator for 3:d party solvers. Each such solver may define its own configurator type.
-
suffice
public Optimisation.Options suffice(CalendarDateDuration duration)
-
-