public class OptionalOperatorTuningScheme extends AbstractOptimizationScheme
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));
Constructor and Description |
---|
OptionalOperatorTuningScheme(IOptimization optimization,
boolean doOperatorTunig,
com.dna.jopt.revision.algorithm.poststepmanagment.operatortuner.OperatorProbabilityTunerPropertyItem props)
Instantiates a new optional operator tuning scheme.
|
Modifier and Type | Method and Description |
---|---|
void |
create()
Creates the defined scheme by adding the algorithms etc.
|
attachCustomNodeLevelRestriction, attachCustomRouteLevelRestriction, getAssessorJobRestrictions, getAssessorMultiRouteRestrictions, getAssessorNodeRestrictions, getAssessorRouteRestrictions, getAutoFilter, getCostAssessor, getCustomDefaultProperties, getOptimization, getOptimizationAlgorithms, initAssessor, postCreate, setAutoFilter, setCostAssessor, setCustomDefaultProperties, setOptimizationAlgorithms
public OptionalOperatorTuningScheme(IOptimization optimization, boolean doOperatorTunig, com.dna.jopt.revision.algorithm.poststepmanagment.operatortuner.OperatorProbabilityTunerPropertyItem props)
optimization
- the optimizationdoOperatorTunig
- the do operator tuningprops
- the propspublic void create()
IOptimizationScheme
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.