Package org.jacop.search
Interface ComparatorVariable<T extends Var>
- Type Parameters:
T
- Variable type being compared.
- All Known Implementing Classes:
ActivityMax
,ActivityMaxDeg
,ActivityMin
,ActivityMinDeg
,AFCMax
,AFCMaxDeg
,AFCMin
,AFCMinDeg
,LargestDomain
,LargestDomainFloat
,LargestMax
,LargestMaxFloat
,LargestMin
,LargestMinFloat
,MaxCardDiff
,MaxGlbCard
,MaxLubCard
,MaxRegret
,MaxRegretFloat
,MinCardDiff
,MinDomainOverDegree
,MinGlbCard
,MinLubCard
,MostConstrainedDynamic
,MostConstrainedStatic
,RandomVar
,SmallestDomain
,SmallestDomainFloat
,SmallestMax
,SmallestMaxFloat
,SmallestMin
,SmallestMinFloat
,WeightedDegree
,WeightedDegreeFloat
public interface ComparatorVariable<T extends Var>
Defines an interface for comparing variables.
- Version:
- 4.10
-
Method Summary
Modifier and TypeMethodDescriptionint
It compares the baseline metric to the variable metric.int
It compares the metric of the left variable against the right one.double
It returns the metric of the variable given according to the comparator.
-
Method Details
-
compare
It compares the baseline metric to the variable metric.- Parameters:
metric
- 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
It compares the metric of the left variable against the right one.- Parameters:
leftVar
- left variablerightVar
- right variable- Returns:
- 1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
-
metric
It returns the metric of the variable given according to the comparator.- Parameters:
var
- variable for which metric is computed.- Returns:
- the metric of the variable according to the comparator.
-