JaCoP.set.search
Class MaxGlbCard<T extends SetVar>

java.lang.Object
  extended by JaCoP.set.search.MaxGlbCard<T>
Type Parameters:
T - type of variable being used in the search.
All Implemented Interfaces:
ComparatorVariable<T>

public class MaxGlbCard<T extends SetVar>
extends java.lang.Object
implements ComparatorVariable<T>

Defines a maximum cardinality, of the greatest lowest bound, variable comparator. The variable with the maximum cardinality for the greatest lower bound has the priority.

Version:
3.1
Author:
Krzysztof Kuchcinski, Robert Ã…kemalm, and Radoslaw Szymanek

Constructor Summary
MaxGlbCard()
          It constructs a maximum cardinality, of the greatest lowest bound, variable comparator.
 
Method Summary
 int compare(float left, T var)
          Compares the cardinality of the variables glb to the float value.
 int compare(T leftVar, T rightVar)
          Compares the cardinality of the variables glbs.
 float metric(T var)
          Returns the cardinality of the glb.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxGlbCard

public MaxGlbCard()
It constructs a maximum cardinality, of the greatest lowest bound, variable comparator.

Method Detail

compare

public int compare(float left,
                   T var)
Compares the cardinality of the variables glb to the float value.

Specified by:
compare in interface ComparatorVariable<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 glbs.

Specified by:
compare in interface ComparatorVariable<T extends SetVar>
Parameters:
leftVar - left variable
rightVar - 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 glb.

Specified by:
metric in interface ComparatorVariable<T extends SetVar>
Parameters:
var - variable for which metric is computed.
Returns:
the metric of the variable according to the comparator.