Package org.jacop.search
Class ActivityMaxDeg<T extends Var>
java.lang.Object
org.jacop.search.ActivityMaxDeg<T>
- Type Parameters:
T- type of variable being compared.
- All Implemented Interfaces:
ComparatorVariable<T>
Defines a pruning activity comparatorfor variables. Every time a constraint
prunes a variable activity weight is increased by one. All other variables of
constraint's activity weight value is recalculated as activity weight * decay.
The comparator will choose the variable with the highest activity
weight divided by its domain size.
- Version:
- 4.10
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateActivityMaxDeg(Store store) ActivityMaxDeg(Store store, double decay) -
Method Summary
Modifier and TypeMethodDescriptionintIt compares the baseline metric to the variable metric.intIt compares the metric of the left variable against the right one.doubleIt returns the metric of the variable given according to the comparator.
-
Constructor Details
-
ActivityMaxDeg
private ActivityMaxDeg() -
ActivityMaxDeg
-
ActivityMaxDeg
-
-
Method Details
-
compare
Description copied from interface:ComparatorVariableIt compares the baseline metric to the variable metric.- Specified by:
comparein interfaceComparatorVariable<T extends Var>- Parameters:
left- the baseline for comparison.var- variable which is compared to baseline.- Returns:
- 1 if metric is larger than variable, 0 if equal, -1 if baseline is smaller.
-
compare
Description copied from interface:ComparatorVariableIt compares the metric of the left variable against the right one.- Specified by:
comparein interfaceComparatorVariable<T extends Var>- Parameters:
leftVar- left variablerightVar- right variable- Returns:
- 1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
-
metric
Description copied from interface:ComparatorVariableIt returns the metric of the variable given according to the comparator.- Specified by:
metricin interfaceComparatorVariable<T extends Var>- Parameters:
var- variable for which metric is computed.- Returns:
- the metric of the variable according to the comparator.
-