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 classWhen a node is determined to be a leaf - no further branching - what was the reason?Nested classes/interfaces inherited from class GenericSolver
GenericSolver.Builder<B,S> 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 TypeFieldDescriptionstatic final IntegerSolver.ModelIntegrationprivate Optimisation.Resultprivate final MultiviewSet<NodeKey> private final MultiaryFunction.TwiceDifferentiable<Double> private final ExpressionsBasedModelprivate final booleanprivate final IntegerSolver.NodeStatisticsFields inherited from class GenericSolver
options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optimisation.Result(package private) booleancompute(NodeKey nodeKey, NodeSolver nodeSolver, CharacterRing.RingLogger nodePrinter, ModelStrategy strategy) protected doubleevaluateFunction(Access1D<?> solution) protected MatrixStore<Double> (package private) static voidflush(CharacterRing.RingLogger buffer, BasicLogger receiver) protected Optimisation.Resultprotected Optimisation.Result(package private) intidentifyNonIntegerVariable(Optimisation.Result nodeResult, NodeKey nodeKey, ModelStrategy strategy) Should return the index of the (best) integer variable to branch on.protected booleanprotected voidlogProgress(int iterationsDone, String classSimpleName, CalendarDateDuration duration) static IntegerSolvermake(ExpressionsBasedModel model) protected voidmarkInteger(NodeKey key, Optimisation.Result result, ModelStrategy strategy) private CharacterRing.RingLoggerstatic IntegerSolvernewSolver(ExpressionsBasedModel model) solve(Optimisation.Result kickStarter) toString()protected booleanvalidate()Should validate the solver data/input/structue.Methods inherited from class GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, printf, resetIterationsCount, setState, setValidator, validate, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
logProgressin 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 integer variable.
-