Package org.jacop.set.search
Class MaxLubCard<T extends SetVar>
- java.lang.Object
-
- org.jacop.set.search.MaxLubCard<T>
-
- Type Parameters:
T- type of variable
- All Implemented Interfaces:
ComparatorVariable<T>
public class MaxLubCard<T extends SetVar> extends java.lang.Object implements ComparatorVariable<T>
Defines a maximum cardinality, of the least upper bound, variable comparator. The variable with the maximum cardinality for the least upper bound has the priority.- Version:
- 4.8
-
-
Constructor Summary
Constructors Constructor Description MaxLubCard()It constructs a maximum cardinality, of the least upper bound, variable comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(float left, T var)Compares the cardinality of the variables lub to the float value.intcompare(T leftVar, T rightVar)Compares the cardinality of the variables lubs.floatmetric(T var)Returns the cardinality of the lub.
-
-
-
Method Detail
-
compare
public int compare(float left, T var)Compares the cardinality of the variables lub to the float value.- Specified by:
comparein interfaceComparatorVariable<T extends SetVar>- 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
public int compare(T leftVar, T rightVar)
Compares the cardinality of the variables lubs.- Specified by:
comparein interfaceComparatorVariable<T extends SetVar>- Parameters:
leftVar- left variablerightVar- right variable- Returns:
- 1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
-
metric
public float metric(T var)
Returns the cardinality of the lub.- Specified by:
metricin interfaceComparatorVariable<T extends SetVar>- Parameters:
var- variable for which metric is computed.- Returns:
- the metric of the variable according to the comparator.
-
-