Package org.ojalgo.optimisation.integer
Class IntegerSolver
java.lang.Object
org.ojalgo.optimisation.GenericSolver
org.ojalgo.optimisation.integer.IntegerSolver
- All Implemented Interfaces:
Optimisation
,Optimisation.Solver
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
(package private) static final class
When a node is determined to be a leaf - no further branching - what was the reason?Nested classes/interfaces inherited from class org.ojalgo.optimisation.GenericSolver
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 TypeFieldDescriptionstatic final IntegerSolver.ModelIntegration
private Optimisation.Result
private final MultiviewSet
<NodeKey> private final MultiaryFunction.TwiceDifferentiable
<Double> private final ExpressionsBasedModel
private final boolean
private final IntegerSolver.NodeStatistics
Fields inherited from class org.ojalgo.optimisation.GenericSolver
options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optimisation.Result
(package private) boolean
compute
(NodeKey nodeKey, NodeSolver nodeSolver, CharacterRing.RingLogger nodePrinter, ModelStrategy strategy) protected double
evaluateFunction
(Access1D<?> solution) protected MatrixStore
<Double> (package private) static void
flush
(CharacterRing.RingLogger buffer, BasicLogger receiver) protected Optimisation.Result
protected Optimisation.Result
(package private) int
identifyNonIntegerVariable
(Optimisation.Result nodeResult, NodeKey nodeKey, ModelStrategy strategy) Should return the index of the (best) integer variable to branch on.protected boolean
protected void
logProgress
(int iterationsDone, String classSimpleName, CalendarDateDuration duration) static IntegerSolver
make
(ExpressionsBasedModel model) protected void
markInteger
(NodeKey key, Optimisation.Result result, ModelStrategy strategy) private CharacterRing.RingLogger
static IntegerSolver
newSolver
(ExpressionsBasedModel model) solve
(Optimisation.Result kickStarter) toString()
protected boolean
validate()
Should validate the solver data/input/structue.Methods inherited from class org.ojalgo.optimisation.GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, resetIterationsCount, setState, setValidator, validate, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
dispose, solve
-
Field Details
-
INTEGRATION
-
myBestResultSoFar
-
myDeferredNodes
-
myFunction
-
myIntegerModel
-
myMinimisation
private final boolean myMinimisation -
myNodeStatistics
-
-
Constructor Details
-
IntegerSolver
IntegerSolver(ExpressionsBasedModel model)
-
-
Method Details
-
make
-
newSolver
-
flush
-
solve
-
toString
-
newPrinter
-
buildResult
-
evaluateFunction
-
extractSolution
-
getBestEstimate
-
getBestResultSoFar
-
isIterationNecessary
protected boolean isIterationNecessary() -
logProgress
protected void logProgress(int iterationsDone, String classSimpleName, CalendarDateDuration duration) - Overrides:
logProgress
in classGenericSolver
-
markInteger
-
validate
protected boolean validate()Should validate the solver data/input/structue. Even "expensive" validation can be performed as the method should only be called if Optimisation.Options.validate is set to true. In addition to returning true or false the implementation should set the state to either Optimisation.State.VALID or Optimisation.State.INVALID (or possibly Optimisation.State.FAILED). Typically the method should be called at the very beginning of the solve-method.- Returns:
- Is the solver instance valid?
-
compute
boolean compute(NodeKey nodeKey, NodeSolver nodeSolver, CharacterRing.RingLogger nodePrinter, ModelStrategy strategy) -
identifyNonIntegerVariable
int identifyNonIntegerVariable(Optimisation.Result nodeResult, NodeKey nodeKey, ModelStrategy strategy) Should return the index of the (best) integer variable to branch on. Returning a negative index means an integer solution has been found (no further branching). Does NOT return a global variable index - it's the index among the ineteger variable.
-