org.jacop.floats.search

## Class LargestMinFloat<T extends FloatVar>

• Type Parameters:
T - type of IntVar being compared.
All Implemented Interfaces:
ComparatorVariable<T>

public class LargestMinFloat<T extends FloatVar>
extends Object
implements ComparatorVariable<T>
Defines a LargestMinFloat comparator for Variables.
Version:
4.9
Author:
• ### Constructor Summary

Constructors
Constructor and Description
LargestMinFloat()
It constructs variable comparator with priority based on the largest minimal value.
• ### Method Summary

All Methods
Modifier and Type Method and Description
int compare(double left, T var)
It compares the baseline metric to the variable metric.
int compare(T leftVar, T rightVar)
It compares the metric of the left variable against the right one.
double metric(T var)
It returns the metric of the variable given according to the comparator.
• ### Constructor Detail

• #### LargestMinFloat

public LargestMinFloat()
It constructs variable comparator with priority based on the largest minimal value.
• ### Method Detail

• #### compare

public int compare(double left,
T var)
Description copied from interface: ComparatorVariable
It compares the baseline metric to the variable metric.
Specified by:
compare in interface ComparatorVariable<T extends FloatVar>
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)
Description copied from interface: ComparatorVariable
It compares the metric of the left variable against the right one.
Specified by:
compare in interface ComparatorVariable<T extends FloatVar>
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 double metric(T var)
Description copied from interface: ComparatorVariable
It returns the metric of the variable given according to the comparator.
Specified by:
metric in interface ComparatorVariable<T extends FloatVar>
Parameters:
var - variable for which metric is computed.
Returns:
the metric of the variable according to the comparator.