Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiHardConstraintEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiHardConstraintEvaluator.cs	(revision 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiHardConstraintEvaluator.cs	(revision 17733)
@@ -106,5 +106,5 @@
                                              ISymbolicExpressionTree solution) {
       return SymbolicRegressionConstraintAnalyzer.ConstraintSatisfied(constraint, new IntervalInterpreter(),
-                                                                      variableRanges, solution) ? 0 : 1;
+                                                                      variableRanges, solution, out double error) ? 0 : 1;
     }
 
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 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator.cs	(revision 17733)
@@ -41,4 +41,5 @@
 
     public IFixedValueParameter<IntValue> DimensionsParameter => (IFixedValueParameter<IntValue>)Parameters[DimensionsParameterName];
+
 
     #region Constructors
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17733)
@@ -46,5 +46,5 @@
       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
 
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) return 0;
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree, out double error)) return 0;
 
       var r2 = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData,
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptNmseEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptNmseEvaluator.cs	(revision 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptNmseEvaluator.cs	(revision 17733)
@@ -15,4 +15,5 @@
     private const string UseConstOptParameterName = "Use ConstOpt";
     private const string ConstOptIterationsParameterName = "ConstOpt Iterations";
+    private const string PenalityMultiplierParameterName = "ConstraintsPenalityMultiplier";
 
     public IFixedValueParameter<BoolValue> UseConstOptParamerter =>
@@ -21,4 +22,7 @@
     public IFixedValueParameter<IntValue> ConstOpterIterationsParameter =>
       (IFixedValueParameter<IntValue>) Parameters[ConstOptIterationsParameterName];
+
+    public ILookupParameter<DoubleValue> PenalityMultiplierParameter =>
+      (ILookupParameter<DoubleValue>)Parameters[PenalityMultiplierParameterName];
 
     public bool UseConstOpt {
@@ -48,4 +52,6 @@
       Parameters.Add(new FixedValueParameter<IntValue>(ConstOptIterationsParameterName,
         "Define how many constOpt iterations should be performed.", new IntValue(10)));
+      Parameters.Add(new LookupParameter<DoubleValue>(PenalityMultiplierParameterName,
+        "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
     }
 
@@ -63,4 +69,8 @@
           "Define how many constOpt iterations should be performed.", new IntValue(10)));
       }
+
+      if (!Parameters.ContainsKey(PenalityMultiplierParameterName))
+        Parameters.Add(new LookupParameter<DoubleValue>(PenalityMultiplierParameterName,
+          "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
     }
 
@@ -81,7 +91,11 @@
           estimationLimits.Lower, estimationLimits.Upper);
 
+      var penalityMultiplier = PenalityMultiplierParameter.ActualValue?.Value ?? 1.0;
+
       var quality = Calculate(interpreter, solution, estimationLimits.Lower, estimationLimits.Upper, problemData, rows,
-        applyLinearScaling);
+        applyLinearScaling, penalityMultiplier);
       QualityParameter.ActualValue = new DoubleValue(quality);
+
+
       return base.InstrumentedApply();
     }
@@ -91,5 +105,6 @@
       ISymbolicExpressionTree solution, double lowerEstimationLimit,
       double upperEstimationLimit,
-      IRegressionProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling) {
+      IRegressionProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling, 
+      double penalityMultiplier) {
       var estimatedValues =
         interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
@@ -98,9 +113,15 @@
       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
 
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution))
-        return 1.0;
-
       var boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
       var nmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out var errorState);
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution, out double error))
+      {
+        if (double.IsNaN(error) || double.IsInfinity(error))
+          nmse += penalityMultiplier * 1.0;
+        else
+          nmse += penalityMultiplier * error;
+        nmse = Math.Min(1.0, nmse);
+      }
+
       if (errorState != OnlineCalculatorError.None) nmse = 1.0;
 
@@ -115,8 +136,11 @@
       ApplyLinearScalingParameter.ExecutionContext                  = context;
 
+      var penalityMultiplier = PenalityMultiplierParameter.ActualValue?.Value ?? 1.0;
+
       var nmse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
         EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
         problemData, rows,
-        ApplyLinearScalingParameter.ActualValue.Value);
+        ApplyLinearScalingParameter.ActualValue.Value,
+        penalityMultiplier);
 
       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17733)
@@ -50,5 +50,5 @@
       var tree           = solution;
 
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) return 0;
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree, out double error)) return 0;
 
       var r2 = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, solution,
Index: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintScalingNmseEvaluator.cs
===================================================================
--- branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintScalingNmseEvaluator.cs	(revision 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintScalingNmseEvaluator.cs	(revision 17733)
@@ -85,5 +85,5 @@
       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
 
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution))
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, solution, out double error))
         return 1.0;
 
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 17722)
+++ branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs	(revision 17733)
@@ -3,10 +3,13 @@
 using System.Collections.ObjectModel;
 using System.Linq;
+using System.Threading;
 using HEAL.Attic;
 using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
 using HeuristicLab.Parameters;
 
@@ -17,4 +20,5 @@
     private const string ProblemDataParameterName         = "ProblemData";
     private const string ConstraintViolationParameterName = "ConstraintViolations";
+    private const string PenalityMultiplierParameterName = "ConstraintsPenalityMultiplier";
 
     #region parameter properties
@@ -26,7 +30,11 @@
       (IResultParameter<DataTable>) Parameters[ConstraintViolationParameterName];
 
+    public ILookupParameter<DoubleValue> PenalityMultiplierParameter =>
+      (ILookupParameter<DoubleValue>)Parameters[PenalityMultiplierParameterName];
+
     #endregion
 
     public override bool EnabledByDefault => false;
+    public static int Iterations { get; set; } = 0;
 
     [StorableConstructor]
@@ -42,21 +50,46 @@
     public SymbolicRegressionConstraintAnalyzer() {
       Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName,
-                                                                 "The problem data of the symbolic data analysis problem."));
+        "The problem data of the symbolic data analysis problem."));
       Parameters.Add(new ResultParameter<DataTable>(ConstraintViolationParameterName,
-                                                    "Shows the number of constraint violations!"));
+        "Shows the number of constraint violations!"));
+      Parameters.Add(new LookupParameter<DoubleValue>(PenalityMultiplierParameterName,
+        "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
+
       ConstraintViolationParameter.DefaultValue = new DataTable(ConstraintViolationParameterName) {
-                                                                                                    VisualProperties = {
-                                                                                                                         XAxisTitle
-                                                                                                                           = "Generations",
-                                                                                                                         YAxisTitle
-                                                                                                                           = "Constraint Violations"
-                                                                                                                       }
-                                                                                                  };
+        VisualProperties = 
+          {
+            XAxisTitle = "Generations",
+            YAxisTitle = "Constraint Violations"
+          }
+      };
     }
 
+    public override void InitializeState()
+    {
+      Iterations = 0;
+      base.InitializeState();
+    }
+
+    public override void ClearState()
+    {
+      Iterations = 0;
+      base.ClearState();
+    }
+
+
     [StorableHook(HookType.AfterDeserialization)]
-    private void AfterDeserialization() { }
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(PenalityMultiplierParameterName))
+        Parameters.Add(new LookupParameter<DoubleValue>(PenalityMultiplierParameterName,
+        "Lookup parameter for the penality multiplier.", "PenalityMultiplier"));
+    }
 
-    public override IOperation Apply() {
+    public override IOperation Apply()
+    {
+      Iterations++;
+
+      PenalityMultiplierParameter.ActualValue = new DoubleValue(QuadraticDiscreteDoubleValueModifier.Calculate(0, 0.05, 1.0, Iterations, 0, 2000));
+      //GeneralizedExponentialDiscreteDoubleValueModifier
+
       var problemData = RegressionProblemDataParameter.ActualValue;
       var trees       = SymbolicExpressionTreeParameter.ActualValue;
@@ -73,5 +106,5 @@
       var interpreter = new IntervalInterpreter();
       foreach (var constraint in constraints) {
-        var violations = trees.Select(tree => ConstraintSatisfied(constraint, interpreter, variableRanges, tree))
+        var violations = trees.Select(tree => ConstraintSatisfied(constraint, interpreter, variableRanges, tree, out double error))
                               .Count(satisfied => !satisfied);
         newDataTable.Rows[constraint.Expression].Values.Add(violations);
@@ -81,8 +114,9 @@
     }
 
-    public static bool ConstraintSatisfied(IntervalConstraint            constraint,
-                                           IntervalInterpreter           intervalInterpreter,
+    public static bool ConstraintSatisfied(IntervalConstraint constraint,
+                                           IntervalInterpreter intervalInterpreter,
                                            IReadOnlyDictionary<string, Interval> variableRanges,
-                                           ISymbolicExpressionTree       solution) {
+                                           ISymbolicExpressionTree solution,
+                                           out double error) {
       if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
         throw new
@@ -121,12 +155,31 @@
       }
 
-      var satisfied = constraint.Interval.Contains(resultInterval);
+      error = 0.0;
+      bool satisfied = true;
+      if(!constraint.Interval.Contains(resultInterval.LowerBound))
+      {
+        satisfied = false;
+        error += Math.Abs(resultInterval.LowerBound - constraint.Interval.LowerBound);
+      }
+
+      if (!constraint.Interval.Contains(resultInterval.UpperBound))
+      {
+        satisfied = false;
+        error += Math.Abs(resultInterval.UpperBound - constraint.Interval.UpperBound);
+      }
+
+      error *= constraint.Weight;
+
+      //var satisfied = constraint.Interval.Contains(resultInterval);
       return satisfied;
     }
 
     public static bool ConstraintsSatisfied(IEnumerable<IntervalConstraint> constraints,
-                                            IReadOnlyDictionary<string, Interval>   variableRanges,
-                                            ISymbolicExpressionTree         solution) {
+                                            IReadOnlyDictionary<string, Interval> variableRanges,
+                                            ISymbolicExpressionTree solution,
+                                            out double error) {
       var intervalInterpreter = new IntervalInterpreter();
+      error = 0.0;
+      var satisfied = true;
       foreach (var constraint in constraints) {
         if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
@@ -135,9 +188,10 @@
                               nameof(IntervalConstraintsParser));
 
-        var satisfied = ConstraintSatisfied(constraint, intervalInterpreter, variableRanges, solution);
-        if (!satisfied) return false;
+        satisfied = ConstraintSatisfied(constraint, intervalInterpreter, variableRanges, solution, out double e) && satisfied;
+        error += e;
+        //if (!satisfied) return false;
       }
 
-      return true;
+      return satisfied;
     }
   }
