Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/20 15:39:46 (4 years ago)
Author:
chaider
Message:

#3073 Fixed error calculation in IABoundsEstimator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IABoundsEstimator.cs

    r17768 r17773  
    474474        var modelBound = Evaluate(instructions, ref instructionCounter, variableIntervals: occuringVariableRanges);
    475475        if (constraint.Interval.Contains(modelBound)) return 0.0;
    476         return Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound) +
    477                Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound);
     476
     477
     478        var error = 0.0;
     479
     480        if (!constraint.Interval.Contains(modelBound.LowerBound)) {
     481            error += Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound);
     482        }
     483
     484        if (!constraint.Interval.Contains(modelBound.UpperBound)) {
     485            error += Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound);
     486        }
     487
     488        return error;
     489        // return Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound) +
     490        //Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound);
    478491      }
    479492
Note: See TracChangeset for help on using the changeset viewer.