Package org.ojalgo.optimisation
Class ExpressionsBasedModel.Integration<S extends Optimisation.Solver>
java.lang.Object
org.ojalgo.optimisation.ExpressionsBasedModel.Integration<S>
- All Implemented Interfaces:
Optimisation
,Optimisation.Integration<ExpressionsBasedModel,
S>
- Direct Known Subclasses:
ConfiguredIntegration
,ConvexSolver.ModelIntegration
,GomorySolver.ModelIntegration
,IntegerSolver.ModelIntegration
,LinearSolver.ModelIntegration
,LinearSolver.NewIntegration
,LinearSolver.OldIntegration
,ServiceIntegration
- Enclosing class:
ExpressionsBasedModel
public abstract static class ExpressionsBasedModel.Integration<S extends Optimisation.Solver>
extends Object
implements Optimisation.Integration<ExpressionsBasedModel,S>
Optimisation.Solver
:s that should be usabale from ExpressionsBasedModel
needs to
implement a subclass of this.-
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Optimisation.Result
Extract state from the model and convert it to solver state.protected int
getIndexInSolver
(ExpressionsBasedModel model, Variable variable) protected final boolean
isSwitch
(ExpressionsBasedModel model) protected final ExpressionsBasedModel.Validator
protected final void
setSwitch
(ExpressionsBasedModel model, boolean value) toModelState
(Optimisation.Result solverState, ExpressionsBasedModel model) Convert solver state to model state.toSolverState
(Optimisation.Result modelState, ExpressionsBasedModel model) Convert model state to solver state.withCapabilityPredicate
(Predicate<ExpressionsBasedModel> capabilityPredicate) Use this to limit the cases where thisOptimisation.Integration
would be used.withOptionsModifier
(Consumer<Optimisation.Options> optionsModifier) Intercept and modify theOptimisation.Options
instance before building the solver.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.Integration
build, isCapable
-
Constructor Details
-
Integration
public Integration()
-
-
Method Details
-
extractSolverState
Description copied from interface:Optimisation.Integration
Extract state from the model and convert it to solver state.- Specified by:
extractSolverState
in interfaceOptimisation.Integration<ExpressionsBasedModel,
S extends Optimisation.Solver> - See Also:
-
toModelState
public Optimisation.Result toModelState(Optimisation.Result solverState, ExpressionsBasedModel model) Description copied from interface:Optimisation.Integration
Convert solver state to model state. Transforming the solution (set of variable values) is the main concern. Adjusting the objective function value (if needed) is best handled elsewhere, and is not required here.The required behaviour here depends on how
Optimisation.Integration.build(Optimisation.Model)
is implemented, and is the reverse mapping ofOptimisation.Integration.toSolverState(Optimisation.Result, Optimisation.Model)
.- Specified by:
toModelState
in interfaceOptimisation.Integration<ExpressionsBasedModel,
S extends Optimisation.Solver>
-
toSolverState
public Optimisation.Result toSolverState(Optimisation.Result modelState, ExpressionsBasedModel model) Description copied from interface:Optimisation.Integration
Convert model state to solver state. Transforming the solution (set of variable values) is the main concern. Adjusting the objective function value (if needed) is best handled elsewhere, and is not required here.The required behaviour here depends on how
Optimisation.Integration.build(Optimisation.Model)
is implemented, and is the reverse mapping ofOptimisation.Integration.toModelState(Result, Optimisation.Model)
.- Specified by:
toSolverState
in interfaceOptimisation.Integration<ExpressionsBasedModel,
S extends Optimisation.Solver>
-
withCapabilityPredicate
public final ExpressionsBasedModel.Integration<S> withCapabilityPredicate(Predicate<ExpressionsBasedModel> capabilityPredicate) Use this to limit the cases where thisOptimisation.Integration
would be used.Returns a new Integration instance where the supplied
Predicate
needs to test true in addition to the underlyingOptimisation.Integration.isCapable(Optimisation.Model)
. -
withOptionsModifier
public final ExpressionsBasedModel.Integration<S> withOptionsModifier(Consumer<Optimisation.Options> optionsModifier) Intercept and modify theOptimisation.Options
instance before building the solver. -
getIndexInSolver
- Returns:
- The index with which one can reference parameters related to this variable in the solver.
-
isSwitch
-
newValidator
-
setSwitch
-