- java.lang.Object
-
- org.ojalgo.optimisation.integer.ModelStrategy
-
- org.ojalgo.optimisation.integer.ModelStrategy.DefaultStrategy
-
- All Implemented Interfaces:
IntegerStrategy
- Enclosing class:
- ModelStrategy
static final class ModelStrategy.DefaultStrategy extends ModelStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.optimisation.integer.ModelStrategy
ModelStrategy.AbstractStrategy, ModelStrategy.DefaultStrategy
-
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.integer.IntegerStrategy
IntegerStrategy.ConfigurableStrategy, IntegerStrategy.GMICutConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description private static doubleDEFAULT_INFEASIBLE_PENALTYprivate intmyCutFailedStreakAdaptive cut generation stateprivate intmyCutLastDepthAdaptive cut generation stateprivate longmyCutNodesSinceLastSuccessAdaptive cut generation stateprivate int[]myLowerCountprivate double[]myLowerPseudoWeightPseudo-costs when downprivate int[]myUpperCountprivate double[]myUpperPseudoWeightPseudo-costs when upprivate static intRELIABILITY_MINprivate static NumberContextROUGHLY-
Fields inherited from class org.ojalgo.optimisation.integer.ModelStrategy
cutting
-
Fields inherited from interface org.ojalgo.optimisation.integer.IntegerStrategy
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description DefaultStrategy(ExpressionsBasedModel model, IntegerStrategy strategy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ModelStrategyinitialise(MultiaryFunction.TwiceDifferentiable<java.lang.Double> function, Access1D<?> point)Initialise the integer significances, based on the objective function gradient.protected booleanisCutRatherThanBranch(NodeKey nodeKey, int branchIntegerIndex, double variableValue, double nodeValue, Optimisation.Result bestResultSoFar)Decide if cuts should be attempted at this node.protected voidmarkInfeasible(NodeKey key, boolean found, double incumbentValue)scale-aware infeasible update using any available cutoff (incumbent or best bound)protected voidmarkInteger(NodeKey key, Optimisation.Result result)protected voidonCutFailure()Called after a failed cut generation attempt (no cuts added).protected voidonCutSuccess(NodeKey nodeKey)Called after a successful cut generation attempt.protected voidonNodeSolved(NodeKey key, Optimisation.Result result, double objective, boolean minimisation)Hook to update pseudo-costs after a node is solved.private static doubleproductScore(double wDown, double wUp, double distDn, double distUp)protected doublescoreBranch(int idx, double distanceDown, double distanceUp, boolean found)protected doublescoreBranchDown(int idx, double distanceDown, boolean found)protected doublescoreBranchUp(int idx, double distanceUp, boolean found)private voidupdatePseudo(int idx, boolean upper, double observation)-
Methods inherited from class org.ojalgo.optimisation.integer.ModelStrategy
countIntegerVariables, countUniqueStrategies, getGapTolerance, getGMICutConfiguration, getIndex, getIntegralityTolerance, getWorkerPriorities, isGoodEnough, isMinimisation, newModelStrategy, toString
-
-
-
-
Field Detail
-
DEFAULT_INFEASIBLE_PENALTY
private static final double DEFAULT_INFEASIBLE_PENALTY
-
RELIABILITY_MIN
private static final int RELIABILITY_MIN
- See Also:
- Constant Field Values
-
ROUGHLY
private static final NumberContext ROUGHLY
-
myCutFailedStreak
private volatile int myCutFailedStreak
Adaptive cut generation state
-
myCutLastDepth
private volatile int myCutLastDepth
Adaptive cut generation state
-
myCutNodesSinceLastSuccess
private volatile long myCutNodesSinceLastSuccess
Adaptive cut generation state
-
myLowerCount
private final int[] myLowerCount
-
myLowerPseudoWeight
private final double[] myLowerPseudoWeight
Pseudo-costs when down
-
myUpperCount
private final int[] myUpperCount
-
myUpperPseudoWeight
private final double[] myUpperPseudoWeight
Pseudo-costs when up
-
-
Constructor Detail
-
DefaultStrategy
DefaultStrategy(ExpressionsBasedModel model, IntegerStrategy strategy)
-
-
Method Detail
-
productScore
private static double productScore(double wDown, double wUp, double distDn, double distUp)
-
updatePseudo
private void updatePseudo(int idx, boolean upper, double observation)
-
initialise
protected ModelStrategy initialise(MultiaryFunction.TwiceDifferentiable<java.lang.Double> function, Access1D<?> point)
Initialise the integer significances, based on the objective function gradient.- Specified by:
initialisein classModelStrategy
-
isCutRatherThanBranch
protected boolean isCutRatherThanBranch(NodeKey nodeKey, int branchIntegerIndex, double variableValue, double nodeValue, Optimisation.Result bestResultSoFar)
Description copied from class:ModelStrategyDecide if cuts should be attempted at this node.- Specified by:
isCutRatherThanBranchin classModelStrategy
-
markInfeasible
protected void markInfeasible(NodeKey key, boolean found, double incumbentValue)
scale-aware infeasible update using any available cutoff (incumbent or best bound)- Specified by:
markInfeasiblein classModelStrategy
-
markInteger
protected void markInteger(NodeKey key, Optimisation.Result result)
- Specified by:
markIntegerin classModelStrategy
-
onCutFailure
protected void onCutFailure()
Called after a failed cut generation attempt (no cuts added). Original behaviour was to disable.- Specified by:
onCutFailurein classModelStrategy
-
onCutSuccess
protected void onCutSuccess(NodeKey nodeKey)
Called after a successful cut generation attempt.- Specified by:
onCutSuccessin classModelStrategy
-
onNodeSolved
protected void onNodeSolved(NodeKey key, Optimisation.Result result, double objective, boolean minimisation)
Description copied from class:ModelStrategyHook to update pseudo-costs after a node is solved.- Specified by:
onNodeSolvedin classModelStrategy
-
scoreBranch
protected double scoreBranch(int idx, double distanceDown, double distanceUp, boolean found)- Specified by:
scoreBranchin classModelStrategy
-
scoreBranchDown
protected double scoreBranchDown(int idx, double distanceDown, boolean found)- Specified by:
scoreBranchDownin classModelStrategy
-
scoreBranchUp
protected double scoreBranchUp(int idx, double distanceUp, boolean found)- Specified by:
scoreBranchUpin classModelStrategy
-
-