getSingleBoxAndVerify(new IntervalValue(3,4), new IntervalValue(3,4))), wid);
}
@Test
public void testTwoDimensionWithThresholds02() {
IntegerBoxes left = getSingleBoxAndVerify(new IntervalValue(0,10), new IntervalValue(0, 1));
IntegerBoxes right = IntegerBoxesHelper.join(
getSingleBoxAndVerify(new IntervalValue(0,2), new IntervalValue(0, 5)),
getSingleBoxAndVerify(new IntervalValue(3,6), new IntervalValue(0, 1)),
getSingleBoxAndVerify(new IntervalValue(7,8), new IntervalValue(0,2)),
getSingleBoxAndVerify(new IntervalValue(9,10), new IntervalValue(0,1)));
final ArrayList<Variable> variables = left.getVariables();
IntegerBoxes wid = BoxesWideningOperator.computeWidening(left, right,
new WideningStepThresholds() {
@Override
public Set<Double> getThresholds(Variable var) {
List<Double> thresholds;
if (var == variables.get(0))
thresholds = Arrays.asList(2.0, 4.0, 6.0, 8.0, 10.0);
else
thresholds = Arrays.asList(5.0);
return new HashSet<Double>(thresholds);
}
});
IntegerBoxes result = IntegerBoxesHelper.join(
getSingleBoxAndVerify(new IntervalValue(0,2), new IntervalValue(0, Double.POSITIVE_INFINITY)),
getSingleBoxAndVerify(new IntervalValue(3,3), new IntervalValue(0, 4)),
getSingleBoxAndVerify(new IntervalValue(4,5), new IntervalValue(0,1)),
getSingleBoxAndVerify(new IntervalValue(6,9), new IntervalValue(0,4)),
getSingleBoxAndVerify(new IntervalValue(9,10), new IntervalValue(0,1))