Class OptionalOperatorTuningScheme
- All Implemented Interfaces:
IOptimizationScheme
Defining the behavior of the tuner:
For testing purpose the tuner can be disabled via the boolean doOperatorTuning. A property tune can also carry the ability to deactivate operators completely in case a certain operator was not able to generate any cost improvement during the optimization run.
private boolean doOperatorTuning = true;
private boolean hasLicense2Kill = true;
Bound probability values. Probability values for the operators need to be within bounds.
double minValue = 1.0;
double maxValue = 100.0;
A score is defined partially by the number of beneficial calls and partially by the average cost reduction per call. A weightageForCost of 0.9 means 90% of the new probability is based on the cost reduction value.
double weightageForCost = 0.9;
When we assign new probability score we smooth it with the old score. For example a weightageForOldProbability of 0.3 means we take 30% of the old value and 70% of the new value
double weightageForOldProbability = 0.8;
Building the OperatorProbabilityTunerPropertyItem:
OperatorProbabilityTunerPropertyItem tunigProps = OperatorProbabilityTunerPropertyItem.builder()
.minProbabilityValue(minValue)
.maxProbabilityValue(maxValue)
.tuningWeightageForCost(weightageForCost)
.probabilityWeightageForPrevoius(weightageForOldProbability)
.canDeactivateOperators(hasLicense2Kill)
.inDebug(true)
.build();
Invoke scheme with IOptimization.setOptimizationScheme(IOptimizationScheme)
:
optimization.setOptimizationScheme(
new OptionalOperatorTuningScheme(optimization, doOperatorTuning, tunigProps));
- Since:
- Oct 1, 2019
- Version:
- Oct 1, 2019
- Author:
- Jens Richter
-
Constructor Summary
ConstructorDescriptionOptionalOperatorTuningScheme
(IOptimization optimization, boolean doOperatorTunig, com.dna.jopt.revision.algorithm.poststepmanagment.operatortuner.OperatorProbabilityTunerPropertyItem props) Instantiates a new optional operator tuning scheme. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Creates the defined scheme by adding the algorithms etc.Methods inherited from class com.dna.jopt.framework.body.scheme.AbstractOptimizationScheme
attachCustomNodeLevelRestriction, attachCustomRouteLevelRestriction, getAssessorJobRestrictions, getAssessorMultiRouteRestrictions, getAssessorNodeRestrictions, getAssessorRouteRestrictions, getAutoFilter, getCostAssessor, getCustomDefaultProperties, getOptimization, getOptimizationAlgorithms, initAssessor, postCreate, setAutoFilter, setCostAssessor, setCustomDefaultProperties, setOptimizationAlgorithms
-
Constructor Details
-
OptionalOperatorTuningScheme
public OptionalOperatorTuningScheme(IOptimization optimization, boolean doOperatorTunig, com.dna.jopt.revision.algorithm.poststepmanagment.operatortuner.OperatorProbabilityTunerPropertyItem props) Instantiates a new optional operator tuning scheme.- Parameters:
optimization
- the optimizationdoOperatorTunig
- the do operator tuningprops
- the props
-
-
Method Details
-
create
public void create()Description copied from interface:IOptimizationScheme
Creates the defined scheme by adding the algorithms etc.
-