Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator.cs	(revision 17768)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator.cs	(revision 17769)
@@ -39,11 +39,22 @@
     SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator : SymbolicRegressionMultiObjectiveSplittingEvaluator {
     public const string DimensionsParameterName = "Dimensions";
-
-    public IFixedValueParameter<IntValue> DimensionsParameter => (IFixedValueParameter<IntValue>)Parameters[DimensionsParameterName];
-
+    private const string BoundsEstimatorParameterName = "Bounds estimator";
+
+    public IFixedValueParameter<IntValue> DimensionsParameter =>
+      (IFixedValueParameter<IntValue>) Parameters[DimensionsParameterName];
+
+    public IValueParameter<IBoundsEstimator> BoundsEstimatorParameter =>
+      (IValueParameter<IBoundsEstimator>) Parameters[BoundsEstimatorParameterName];
+
+    public IBoundsEstimator BoundsEstimator {
+      get => BoundsEstimatorParameter.Value;
+      set => BoundsEstimatorParameter.Value = value;
+    }
 
     #region Constructors
+
     public SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator() {
       Parameters.Add(new FixedValueParameter<IntValue>(DimensionsParameterName, new IntValue(2)));
+      Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName, new IABoundsEstimator()));
     }
 
@@ -58,6 +69,9 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
-      if(!Parameters.ContainsKey(DimensionsParameterName))
+      if (!Parameters.ContainsKey(DimensionsParameterName))
         Parameters.Add(new FixedValueParameter<IntValue>(DimensionsParameterName, new IntValue(2)));
+
+      if (!Parameters.ContainsKey(BoundsEstimatorParameterName))
+        Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName, new IABoundsEstimator()));
     }
 
@@ -68,46 +82,12 @@
 
     public override IOperation InstrumentedApply() {
-      var rows                  = GenerateRowsToEvaluate();
-      var solution              = SymbolicExpressionTreeParameter.ActualValue;
-      var problemData           = ProblemDataParameter.ActualValue;
-      var interpreter           = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
-      var estimationLimits      = EstimationLimitsParameter.ActualValue;
-      var minIntervalWidth      = MinSplittingWidth;
-      var maxIntervalSplitDepth = MaxSplittingDepth;
-      var applyLinearScaling  = ApplyLinearScalingParameter.ActualValue.Value;
-
-      if (applyLinearScaling) {
-        //Check for interval arithmetic grammar
-        //remove scaling nodes for linear scaling evaluation
-        var                    rootNode  = new ProgramRootSymbol().CreateTreeNode();
-        var                    startNode = new StartSymbol().CreateTreeNode();
-        SymbolicExpressionTree newTree   = null;
-        foreach (var node in solution.IterateNodesPrefix())
-          if (node.Symbol.Name == "Scaling") {
-            for (var i = 0; i < node.SubtreeCount; ++i) startNode.AddSubtree(node.GetSubtree(i));
-            rootNode.AddSubtree(startNode);
-            newTree = new SymbolicExpressionTree(rootNode);
-            break;
-          }
-
-        //calculate alpha and beta for scaling
-        var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(newTree, problemData.Dataset, rows);
-        var targetValues    = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
-        OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out var alpha, out var beta,
-          out var errorState);
-        //Set alpha and beta to the scaling nodes from ia grammar
-        foreach (var node in solution.IterateNodesPrefix())
-          if (node.Symbol.Name == "Offset") {
-            node.RemoveSubtree(1);
-            var alphaNode = new ConstantTreeNode(new Constant()) {Value = alpha};
-            node.AddSubtree(alphaNode);
-          } else if (node.Symbol.Name == "Scaling") {
-            node.RemoveSubtree(1);
-            var betaNode = new ConstantTreeNode(new Constant()) {Value = beta};
-            node.AddSubtree(betaNode);
-          }
-      }
-
-      if (UseConstantOptimization)
+      var rows = GenerateRowsToEvaluate();
+      var solution = SymbolicExpressionTreeParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      var estimationLimits = EstimationLimitsParameter.ActualValue;
+      var applyLinearScaling = ApplyLinearScalingParameter.ActualValue.Value;
+
+      if (UseConstantOptimization) {
         SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows,
           false,
@@ -116,25 +96,59 @@
           estimationLimits.Lower,
           estimationLimits.Upper);
+      } else {
+        if (applyLinearScaling) {
+          //Check for interval arithmetic grammar
+          //remove scaling nodes for linear scaling evaluation
+          var rootNode = new ProgramRootSymbol().CreateTreeNode();
+          var startNode = new StartSymbol().CreateTreeNode();
+          SymbolicExpressionTree newTree = null;
+          foreach (var node in solution.IterateNodesPrefix())
+            if (node.Symbol.Name == "Scaling") {
+              for (var i = 0; i < node.SubtreeCount; ++i) startNode.AddSubtree(node.GetSubtree(i));
+              rootNode.AddSubtree(startNode);
+              newTree = new SymbolicExpressionTree(rootNode);
+              break;
+            }
+
+          //calculate alpha and beta for scaling
+          var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(newTree, problemData.Dataset, rows);
+          var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
+          OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out var alpha, out var beta,
+            out var errorState);
+          //Set alpha and beta to the scaling nodes from ia grammar
+          foreach (var node in solution.IterateNodesPrefix())
+            if (node.Symbol.Name == "Offset") {
+              node.RemoveSubtree(1);
+              var alphaNode = new ConstantTreeNode(new Constant()) {Value = alpha};
+              node.AddSubtree(alphaNode);
+            } else if (node.Symbol.Name == "Scaling") {
+              node.RemoveSubtree(1);
+              var betaNode = new ConstantTreeNode(new Constant()) {Value = beta};
+              node.AddSubtree(betaNode);
+            }
+        }
+      }
 
       var qualities = Calculate(interpreter, solution, estimationLimits.Lower, estimationLimits.Upper, problemData,
-        rows, UseIntervalSplitting);
+        rows, BoundsEstimator);
       QualitiesParameter.ActualValue = new DoubleArray(qualities);
       return base.InstrumentedApply();
     }
 
-    public override double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree,
-                                      IRegressionProblemData problemData,
-                                      IEnumerable<int> rows) {
+    public override double[] Evaluate(
+      IExecutionContext context, ISymbolicExpressionTree tree,
+      IRegressionProblemData problemData,
+      IEnumerable<int> rows) {
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
-      EstimationLimitsParameter.ExecutionContext                    = context;
-      ApplyLinearScalingParameter.ExecutionContext                  = context;
+      EstimationLimitsParameter.ExecutionContext = context;
+      ApplyLinearScalingParameter.ExecutionContext = context;
 
       var quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
         EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
-        problemData, rows, UseIntervalSplitting);
+        problemData, rows, BoundsEstimator);
 
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
-      EstimationLimitsParameter.ExecutionContext                    = null;
-      ApplyLinearScalingParameter.ExecutionContext                  = null;
+      EstimationLimitsParameter.ExecutionContext = null;
+      ApplyLinearScalingParameter.ExecutionContext = null;
 
       return quality;
@@ -142,12 +156,14 @@
 
 
-    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
-                                     ISymbolicExpressionTree solution, double lowerEstimationLimit,
-                                     double upperEstimationLimit,
-                                     IRegressionProblemData problemData, IEnumerable<int> rows, bool splitting) {
+    public static double[] Calculate(
+      ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+      ISymbolicExpressionTree solution, double lowerEstimationLimit,
+      double upperEstimationLimit,
+      IRegressionProblemData problemData, IEnumerable<int> rows, IBoundsEstimator estimator) {
       OnlineCalculatorError errorState;
-      var estimatedValues =
-        interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
+      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
       var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
+      var constraints = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
+      var intervalCollection = problemData.VariableRanges;
 
       double nmse;
@@ -160,64 +176,27 @@
         nmse = 1.0;
 
-      var constraints    = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
-      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
-
-      var objectives          = new List<double> {nmse};
-      var intervalInterpreter = new IntervalInterpreter(){UseIntervalSplitting = splitting};
-
-      var constraintObjectives = new List<double>();
-      foreach (var c in constraints) {
-        var penalty = ConstraintExceeded(c, intervalInterpreter, variableRanges,
-          solution);
-        var maxP = 0.1;
-
-        if (double.IsNaN(penalty) || double.IsInfinity(penalty) || penalty > maxP)
-          penalty = maxP;
-
-        constraintObjectives.Add(penalty);
-      }
-
-      objectives.AddRange(constraintObjectives);
-
+
+      var objectives = new List<double> {nmse};
+      ////var intervalInterpreter = new IntervalInterpreter() {UseIntervalSplitting = splitting};
+
+      //var constraintObjectives = new List<double>();
+      //foreach (var c in constraints) {
+      //  var penalty = ConstraintExceeded(c, intervalInterpreter, variableRanges,
+      //    solution);
+      //  var maxP = 0.1;
+
+      //  if (double.IsNaN(penalty) || double.IsInfinity(penalty) || penalty > maxP)
+      //    penalty = maxP;
+
+      //  constraintObjectives.Add(penalty);
+      //}
+
+      //objectives.AddRange(constraintObjectives);
+
+      //return objectives.ToArray();
+
+      var results = IntervalUtil.IntervalConstraintsViolation(constraints, estimator, intervalCollection, solution);
+      objectives.AddRange(results);
       return objectives.ToArray();
-    }
-
-    public static double ConstraintExceeded(IntervalConstraint constraint, IntervalInterpreter intervalInterpreter,
-                                            IReadOnlyDictionary<string, Interval> variableRanges,
-                                            ISymbolicExpressionTree solution) {
-      if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
-        throw new ArgumentException(
-          $"The given variable {constraint.Variable} in the constraint does not exists in the model.",
-          nameof(IntervalConstraintsParser));
-      Interval resultInterval;
-      if (!constraint.IsDerivative) {
-        resultInterval =
-          intervalInterpreter.GetSymbolicExpressionTreeInterval(solution, variableRanges);
-      }
-      else {
-        var tree = solution;
-        for (var i = 0; i < constraint.NumberOfDerivations; ++i)
-          tree = DerivativeCalculator.Derive(tree, constraint.Variable);
-
-        resultInterval =
-          intervalInterpreter.GetSymbolicExpressionTreeInterval(tree, variableRanges);
-      }
-      
-      //Calculate soft-constraints for intervals
-      if (constraint.Interval.Contains(resultInterval)) return 0;
-      var pLower = 0.0;
-      var pUpper = 0.0;
-      if (constraint.Interval.Contains(resultInterval.LowerBound))
-        pLower = 0;
-      else
-        pLower = constraint.Interval.LowerBound - resultInterval.LowerBound;
-
-      if (constraint.Interval.Contains(resultInterval.UpperBound))
-        pUpper = 0;
-      else
-        pUpper = resultInterval.UpperBound - constraint.Interval.UpperBound;
-      var penalty = Math.Abs(pLower) + Math.Abs(pUpper);
-
-      return penalty;
     }
 
@@ -226,9 +205,10 @@
      * All following objectives have to be minimized ==> Constraints
      */
+
     public override IEnumerable<bool> Maximization {
       get {
-        var objectives = new List<bool> {false};          //First NMSE ==> min
+        var objectives = new List<bool> {false}; //First NMSE ==> min
         objectives.AddRange(Enumerable.Repeat(false, DimensionsParameter.Value.Value)); //Constraints ==> min
-        
+
         return objectives;
       }
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintEvaluator.cs	(revision 17768)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintEvaluator.cs	(revision 17769)
@@ -43,5 +43,5 @@
 
     public IValueParameter<IBoundsEstimator> BoundsEstimatorParameter =>
-      (IValueParameter<IBoundsEstimator>)Parameters[BoundsEstimatorParameterName];
+      (IValueParameter<IBoundsEstimator>) Parameters[BoundsEstimatorParameterName];
 
     public bool UseConstantOptimization {
@@ -122,5 +122,4 @@
         Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName,
           "Select the Boundsestimator.", new IABoundsEstimator()));
-
     }
 
@@ -178,5 +177,5 @@
 
       var quality = Calculate(interpreter, solution, estimationLimits.Lower, estimationLimits.Upper, problemData, rows,
-        UseSoftConstraints, PenaltyMultiplier);
+        PenaltyMultiplier, BoundsEstimator);
       QualityParameter.ActualValue = new DoubleValue(quality);
 
@@ -188,10 +187,10 @@
       ISymbolicExpressionTree solution, double lowerEstimationLimit,
       double upperEstimationLimit,
-      IRegressionProblemData problemData, IEnumerable<int> rows, bool useSoftConstraints,
-      double penaltyMultiplier) {
+      IRegressionProblemData problemData, IEnumerable<int> rows,
+      double penaltyMultiplier, IBoundsEstimator estimator) {
       var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
       var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
       var constraints = problemData.IntervalConstraints.EnabledConstraints;
-      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
+      var intervalCollection = problemData.VariableRanges;
 
       var boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
@@ -199,20 +198,26 @@
         out var errorState);
 
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution,
-        out var error)) {
-        if (useSoftConstraints) {
-          if (double.IsNaN(error) || double.IsInfinity(error)) {
-            nmse += penaltyMultiplier * 1.0;
-          } else {
-            nmse += penaltyMultiplier * error;
-          }
-
-          nmse = Math.Min(1.0, nmse);
-        } else {
-          nmse = 1.0;
-        }
-      }
-
       if (errorState != OnlineCalculatorError.None) {
+        return 1.0;
+      }
+
+      //if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution,
+      //  out var error)) {
+      //  if (useSoftConstraints) {
+      //    if (double.IsNaN(error) || double.IsInfinity(error)) {
+      //      nmse += penaltyMultiplier * 1.0;
+      //    } else {
+      //      nmse += penaltyMultiplier * error;
+      //    }
+
+      //    nmse = Math.Min(1.0, nmse);
+      //  } else {
+      //    nmse = 1.0;
+      //  }
+      //}
+
+
+      if (IntervalUtil.IntervalConstraintsViolation(constraints, estimator, intervalCollection, solution)
+                      .Any(x => x != 0.0)) {
         nmse = 1.0;
       }
@@ -230,5 +235,5 @@
       var nmse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
         EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
-        problemData, rows, UseSoftConstraints, PenaltyMultiplier);
+        problemData, rows, PenaltyMultiplier, BoundsEstimator);
 
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs	(revision 17768)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs	(revision 17769)
@@ -29,22 +29,23 @@
 
     public ILookupParameter<IRegressionProblemData> RegressionProblemDataParameter =>
-      (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName];
+      (ILookupParameter<IRegressionProblemData>) Parameters[ProblemDataParameterName];
 
     public IResultParameter<DataTable> ConstraintViolationParameter =>
-      (IResultParameter<DataTable>)Parameters[ConstraintViolationParameterName];
+      (IResultParameter<DataTable>) Parameters[ConstraintViolationParameterName];
 
     public ILookupParameter<DoubleValue> PenalityMultiplierParameter =>
-      (ILookupParameter<DoubleValue>)Parameters[PenalityMultiplierParameterName];
+      (ILookupParameter<DoubleValue>) Parameters[PenalityMultiplierParameterName];
 
     public IValueParameter<IntValue> StepSizeParameter =>
-      (IValueParameter<IntValue>)Parameters[StepSizeParameterName];
+      (IValueParameter<IntValue>) Parameters[StepSizeParameterName];
 
     public IValueParameter<IntValue> MaximumStepsParameter =>
-      (IValueParameter<IntValue>)Parameters[MaximumStepsParameterName];
+      (IValueParameter<IntValue>) Parameters[MaximumStepsParameterName];
 
     public IResultParameter<DataTable> PenalityMultiplierResultParameter =>
-      (IResultParameter<DataTable>)Parameters[PenalityMultiplierResultParameterName];
+      (IResultParameter<DataTable>) Parameters[PenalityMultiplierResultParameterName];
+
     public IValueParameter<DoubleValue> StartPenalityParameter =>
-      (IValueParameter<DoubleValue>)Parameters[StartPenalityParameterName];
+      (IValueParameter<DoubleValue>) Parameters[StartPenalityParameterName];
 
     #endregion
@@ -80,20 +81,16 @@
 
 
-
-
       ConstraintViolationParameter.DefaultValue = new DataTable(ConstraintViolationParameterName) {
-        VisualProperties =
-          {
-            XAxisTitle = "Generations",
-            YAxisTitle = "Constraint Violations"
-          }
+        VisualProperties = {
+          XAxisTitle = "Generations",
+          YAxisTitle = "Constraint Violations"
+        }
       };
 
       PenalityMultiplierResultParameter.DefaultValue = new DataTable(PenalityMultiplierResultParameterName) {
-        VisualProperties =
-          {
-            XAxisTitle = "Generations",
-            YAxisTitle = "Penality Multiplier"
-          }
+        VisualProperties = {
+          XAxisTitle = "Generations",
+          YAxisTitle = "Penality Multiplier"
+        }
       };
     }
@@ -114,13 +111,12 @@
       if (!Parameters.ContainsKey(PenalityMultiplierParameterName))
         Parameters.Add(new LookupParameter<DoubleValue>(PenalityMultiplierParameterName,
-        "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
+          "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
 
       if (!Parameters.ContainsKey(PenalityMultiplierResultParameterName)) {
         Parameters.Add(new ResultParameter<DataTable>(PenalityMultiplierResultParameterName,
-        "Shows the behavior of the penality multiplier."));
+          "Shows the behavior of the penality multiplier."));
 
         PenalityMultiplierResultParameter.DefaultValue = new DataTable(PenalityMultiplierResultParameterName) {
-          VisualProperties =
-          {
+          VisualProperties = {
             XAxisTitle = "Generations",
             YAxisTitle = "Penality Multiplier"
@@ -131,15 +127,14 @@
       if (!Parameters.ContainsKey(StepSizeParameterName))
         Parameters.Add(new ValueParameter<IntValue>(StepSizeParameterName,
-        "Defines the step size for the increasing penality multiplier.", new IntValue(1)));
+          "Defines the step size for the increasing penality multiplier.", new IntValue(1)));
 
       if (!Parameters.ContainsKey(MaximumStepsParameterName))
         Parameters.Add(new ValueParameter<IntValue>(MaximumStepsParameterName,
-        "Defines maximum steps for the increasing penality multiplier.", new IntValue(1000)));
-
+          "Defines maximum steps for the increasing penality multiplier.", new IntValue(1000)));
 
 
       if (!Parameters.ContainsKey(StartPenalityParameterName))
         Parameters.Add(new ValueParameter<DoubleValue>(StartPenalityParameterName,
-        "The start value for the penality multiplier.", new DoubleValue(0.5)));
+          "The start value for the penality multiplier.", new DoubleValue(0.5)));
     }
 
@@ -150,5 +145,6 @@
       var startValue = StartPenalityParameter?.Value?.Value ?? 0.5;
       var maximumSteps = MaximumStepsParameter?.Value?.Value ?? 1000;
-      var penalityMultiplier = new DoubleValue(LinearDiscreteDoubleValueModifier.Apply(0, startValue, 1.0, (int)(Iterations / stepSize) * stepSize, 0, maximumSteps));
+      var penalityMultiplier = new DoubleValue(LinearDiscreteDoubleValueModifier.Apply(0, startValue, 1.0,
+        (int) (Iterations / stepSize) * stepSize, 0, maximumSteps));
       PenalityMultiplierParameter.ActualValue = penalityMultiplier;
       //GeneralizedExponentialDiscreteDoubleValueModifier
@@ -170,5 +166,6 @@
       var interpreter = new IntervalInterpreter();
       foreach (var constraint in constraints) {
-        var violations = trees.Select(tree => ConstraintSatisfied(constraint, interpreter, variableRanges, tree, out double error))
+        var violations = trees.Select(tree =>
+                                 ConstraintSatisfied(constraint, interpreter, variableRanges, tree, out double error))
                               .Count(satisfied => !satisfied);
         newDataTable.Rows[constraint.Expression].Values.Add(violations);
@@ -191,16 +188,16 @@
         throw new
           ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.",
-                            nameof(IntervalConstraintsParser));
+            nameof(IntervalConstraintsParser));
 
       Interval resultInterval;
 
-      // create new variable ranges for defined regions
-      IDictionary<string, Interval> regionRanges = new Dictionary<string, Interval>();
+      //Create new variable ranges for defined regions
+      var regionRanges = new IntervalCollection();
       foreach (var kvp in variableRanges) {
-        var value = constraint.Regions.Where(r => r.VariableName == kvp.Key).FirstOrDefault();
-        if (kvp.Key != constraint.Target && value != null) {
-          regionRanges.Add(kvp.Key, value.Interval);
+        if (kvp.Key != constraint.Target &&
+            constraint.Regions.GetReadonlyDictionary().TryGetValue(kvp.Key, out Interval val)) {
+          regionRanges.AddInterval(kvp.Key, val);
         } else {
-          regionRanges.Add(kvp);
+          regionRanges.AddInterval(kvp.Key, kvp.Value);
         }
       }
@@ -208,5 +205,7 @@
       // calculate result interval
       if (!constraint.IsDerivative) {
-        resultInterval = intervalInterpreter.GetSymbolicExpressionTreeInterval(solution, new ReadOnlyDictionary<string, Interval>(regionRanges));
+        resultInterval =
+          intervalInterpreter.GetSymbolicExpressionTreeInterval(solution,
+            regionRanges.GetReadonlyDictionary());
       } else {
         var tree = solution;
@@ -217,5 +216,7 @@
         }
 
-        resultInterval = intervalInterpreter.GetSymbolicExpressionTreeInterval(tree, new ReadOnlyDictionary<string, Interval>(regionRanges));
+        resultInterval =
+          intervalInterpreter.GetSymbolicExpressionTreeInterval(tree,
+            regionRanges.GetReadonlyDictionary());
       }
 
@@ -248,8 +249,10 @@
         if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
           throw new
-            ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.",
-                              nameof(IntervalConstraintsParser));
-
-        satisfied = ConstraintSatisfied(constraint, intervalInterpreter, variableRanges, solution, out double e) && satisfied;
+            ArgumentException(
+              $"The given variable {constraint.Variable} in the constraint does not exists in the model.",
+              nameof(IntervalConstraintsParser));
+
+        satisfied = ConstraintSatisfied(constraint, intervalInterpreter, variableRanges, solution, out double e) &&
+                    satisfied;
         error += e;
         //if (!satisfied) return false;
