Package org.ojalgo.optimisation
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 class
GenericSolver.Builder<B extends GenericSolver.Builder<B,
S>, S extends GenericSolver> 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
FieldsModifier and TypeFieldDescriptionprivate String
private final AtomicInteger
private Optimisation.State
private final Stopwatch
private ExpressionsBasedModel.Validator
final Optimisation.Options
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
protected
GenericSolver
(Optimisation.Options optimisationOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected final int
protected final long
The number of ms since solver instantiated or iterations count reset.protected final void
protected final String
protected final CalendarDateDuration
The number of s since solver instantiated or iterations count reset.protected Optimisation.State
getState()
protected final int
Should be called after a completed iteration.protected final boolean
Should be called at the start of an iteration (before it actually starts) to check if you should abort instead.protected final boolean
Detailed debug loggingprotected final boolean
isLogOff()
No loggingprotected final boolean
Cursory progress logging (at least)protected final void
log()
protected final void
protected final void
protected final void
protected void
logProgress
(int iterationsDone, String classSimpleName, CalendarDateDuration duration) protected final void
protected final void
setState
(Optimisation.State state) As the solver algorithm reaches various states it should be recorded here.protected final void
setValidator
(ExpressionsBasedModel.Validator validator) Optionally set a validator.protected final boolean
validate
(ExpressionsBasedModel modifiedModel) protected final boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
dispose, solve, solve
-
Field Details
-
options
-
myClassSimpleName
-
myIterationsCount
-
myState
-
myStopwatch
-
myValidator
-
-
Constructor Details
-
GenericSolver
private GenericSolver() -
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) -
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:
-