Class ModelStrategy.DefaultStrategy
java.lang.Object
org.ojalgo.optimisation.integer.ModelStrategy
org.ojalgo.optimisation.integer.ModelStrategy.DefaultStrategy
- All Implemented Interfaces:
IntegerStrategy
- Enclosing class:
ModelStrategy
-
Nested Class Summary
Nested classes/interfaces inherited from class ModelStrategy
ModelStrategy.AbstractStrategy, ModelStrategy.DefaultStrategyNested classes/interfaces inherited from interface IntegerStrategy
IntegerStrategy.ConfigurableStrategy, IntegerStrategy.GMICutConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate intAdaptive cut generation stateprivate intAdaptive cut generation stateprivate longAdaptive cut generation stateprivate final int[]private final double[]Pseudo-costs when downprivate final int[]private final double[]Pseudo-costs when upprivate static final intprivate static final NumberContextFields inherited from class ModelStrategy
cuttingFields inherited from interface IntegerStrategy
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelStrategyinitialise(MultiaryFunction.TwiceDifferentiable<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 voidCalled 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 ModelStrategy
countIntegerVariables, countUniqueStrategies, getGapTolerance, getGMICutConfiguration, getIndex, getIntegralityTolerance, getWorkerPriorities, isGoodEnough, isMinimisation, newModelStrategy, toString
-
Field Details
-
DEFAULT_INFEASIBLE_PENALTY
private static final double DEFAULT_INFEASIBLE_PENALTY -
RELIABILITY_MIN
private static final int RELIABILITY_MIN- See Also:
-
ROUGHLY
-
myCutFailedStreak
private volatile int myCutFailedStreakAdaptive cut generation state -
myCutLastDepth
private volatile int myCutLastDepthAdaptive cut generation state -
myCutNodesSinceLastSuccess
private volatile long myCutNodesSinceLastSuccessAdaptive cut generation state -
myLowerCount
private final int[] myLowerCount -
myLowerPseudoWeight
private final double[] myLowerPseudoWeightPseudo-costs when down -
myUpperCount
private final int[] myUpperCount -
myUpperPseudoWeight
private final double[] myUpperPseudoWeightPseudo-costs when up
-
-
Constructor Details
-
DefaultStrategy
DefaultStrategy(ExpressionsBasedModel model, IntegerStrategy strategy)
-
-
Method Details
-
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<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
scale-aware infeasible update using any available cutoff (incumbent or best bound)- Specified by:
markInfeasiblein classModelStrategy
-
markInteger
- 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
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
-