Class GenericSolver
java.lang.Object
org.ojalgo.optimisation.GenericSolver
- All Implemented Interfaces:
Optimisation, Optimisation.Solver
- Direct Known Subclasses:
ConvexSolver, GomorySolver, IntegerSolver, LinearSolver
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGenericSolver.Builder<B extends GenericSolver.Builder<B,S>, S extends GenericSolver> Nested classes/interfaces inherited from interface Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M,S>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.ProblemStructure, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate final AtomicIntegerprivate Optimisation.Stateprivate final Stopwatchprivate ExpressionsBasedModel.Validatorfinal Optimisation.Options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final intprotected final longThe number of ms since solver instantiated or iterations count reset.protected final voidprotected final Stringprotected final CalendarDateDurationThe number of s since solver instantiated or iterations count reset.protected Optimisation.StategetState()protected final intShould be called after a completed iteration.protected final booleanShould be called at the start of an iteration (before it actually starts) to check if you should abort instead.protected final booleanDetailed debug loggingprotected final booleanisLogOff()No loggingprotected final booleanCursory progress logging (at least)protected final voidlog()protected final voidprotected final voidprotected final voidprotected voidlogProgress(int iterationsDone, String classSimpleName, CalendarDateDuration duration) protected final voidprotected final voidprotected final voidsetState(Optimisation.State state) As the solver algorithm reaches various states it should be recorded here.protected final voidsetValidator(ExpressionsBasedModel.Validator validator) Optionally set a validator.protected final booleanvalidate(ExpressionsBasedModel modifiedModel) protected final booleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Optimisation.Solver
dispose, solve, solve
-
Field Details
-
options
-
myClassSimpleName
-
myIterationsCount
-
myState
-
myStopwatch
-
myValidator
-
-
Constructor Details
-
GenericSolver
-
-
Method Details
-
countIterations
protected final int countIterations() -
countTime
protected final long countTime()The number of ms since solver instantiated or iterations count reset. -
error
-
getClassSimpleName
-
getDuration
The number of s since solver instantiated or iterations count reset. -
getState
-
incrementIterationsCount
protected final int incrementIterationsCount()Should be called after a completed iteration. The iterations count is not "1" untill the first iteration is completed. -
isIterationAllowed
protected final boolean isIterationAllowed()Should be called at the start of an iteration (before it actually starts) to check if you should abort instead. Will return false if either the iterations count or the execution time has reached their respective limits. -
isLogDebug
protected final boolean isLogDebug()Detailed debug logging -
isLogOff
protected final boolean isLogOff()No logging -
isLogProgress
protected final boolean isLogProgress()Cursory progress logging (at least) -
log
protected final void log() -
log
-
log
-
log
-
logProgress
protected void logProgress(int iterationsDone, String classSimpleName, CalendarDateDuration duration) -
printf
-
resetIterationsCount
protected final void resetIterationsCount() -
setState
As the solver algorithm reaches various states it should be recorded here. It's particularly important to record when a feasible solution has been reached. -
setValidator
Optionally set a validator. If set, solvers may callvalidate(Access1D)orvalidate(ExpressionsBasedModel)at suitable points in the code to validate its actions. This is a solver debugging tool - not to be used in production code. -
validate
- See Also:
-
validate
- See Also:
-