Class ConfiguredIntegration<S extends Optimisation.Solver>
java.lang.Object
org.ojalgo.optimisation.ExpressionsBasedModel.Integration<S>
org.ojalgo.optimisation.ConfiguredIntegration<S>
- All Implemented Interfaces:
Optimisation, Optimisation.Integration<ExpressionsBasedModel, S>
final class ConfiguredIntegration<S extends Optimisation.Solver>
extends ExpressionsBasedModel.Integration<S>
-
Nested Class Summary
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 final Predicate<ExpressionsBasedModel> private final ExpressionsBasedModel.Integration<S> private final Consumer<Optimisation.Options> -
Constructor Summary
ConstructorsConstructorDescriptionConfiguredIntegration(ExpressionsBasedModel.Integration<S> delegate, Predicate<ExpressionsBasedModel> capabilityPredicate, Consumer<Optimisation.Options> optionsModifier) -
Method Summary
Modifier and TypeMethodDescriptionbuild(ExpressionsBasedModel model) An integration must be able to instantiate a solver that can handle (any) model instance.booleanisCapable(ExpressionsBasedModel model) toModelState(Optimisation.Result solverState, ExpressionsBasedModel model) toSolverState(Optimisation.Result modelState, ExpressionsBasedModel model) This default implementation assumes the solver state and model state are identical, and simply returns the supplied model state.Methods inherited from class ExpressionsBasedModel.Integration
expandFreeToFull, extractSolverState, getIndexInSolver, isSwitch, newValidator, reduceFullToFree, setSwitch, withCapabilityPredicate, withOptionsModifier
-
Field Details
-
myCapabilityPredicate
-
myDelegate
-
myOptionsModifier
-
-
Constructor Details
-
ConfiguredIntegration
ConfiguredIntegration(ExpressionsBasedModel.Integration<S> delegate, Predicate<ExpressionsBasedModel> capabilityPredicate, Consumer<Optimisation.Options> optionsModifier)
-
-
Method Details
-
build
Description copied from interface:Optimisation.IntegrationAn integration must be able to instantiate a solver that can handle (any) model instance. -
isCapable
- Returns:
- true if this solver (integration) can handle the input model
-
toModelState
public Optimisation.Result toModelState(Optimisation.Result solverState, ExpressionsBasedModel model) Description copied from class:ExpressionsBasedModel.IntegrationThe reverse ofExpressionsBasedModel.Integration.toSolverState(Optimisation.Result, ExpressionsBasedModel).- Specified by:
toModelStatein interfaceOptimisation.Integration<ExpressionsBasedModel, S extends Optimisation.Solver>- Overrides:
toModelStatein classExpressionsBasedModel.Integration<S extends Optimisation.Solver>- See Also:
-
toSolverState
public Optimisation.Result toSolverState(Optimisation.Result modelState, ExpressionsBasedModel model) Description copied from class:ExpressionsBasedModel.IntegrationThis default implementation assumes the solver state and model state are identical, and simply returns the supplied model state.In any case where the set of variables present in the solver does not match what's in the model one-to-one, this method and its reciprocal
ExpressionsBasedModel.Integration.toModelState(Optimisation.Result, ExpressionsBasedModel)needs to be overridden with custom mapping implementations.A very common case is when the solver only works with free (not eliminated by the pre-solver) variables. There are helper methods to do just that.
- Specified by:
toSolverStatein interfaceOptimisation.Integration<ExpressionsBasedModel, S extends Optimisation.Solver>- Overrides:
toSolverStatein classExpressionsBasedModel.Integration<S extends Optimisation.Solver>- See Also:
-