Changeset 17632


Ignore:
Timestamp:
06/24/20 16:14:43 (3 months ago)
Author:
chaider
Message:

#3076 Changed readonly dictionary to normal dicitionary to set new interval in VariableRanges after splitting the intervals

Location:
branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiHardConstraintEvaluator.cs

    r17623 r17632  
    9191
    9292      var constraints    = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
    93       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     93      var variableRanges = problemData.VariableRanges.GetDictionary();
    9494
    9595      var objectives = new List<double> {nmse}; //Add r² to resultlist
     
    103103
    104104    private static double ConstraintExceeded(IntervalConstraint constraint, IntervalInterpreter intervalInterpreter,
    105                                              IReadOnlyDictionary<string, Interval> variableRanges,
     105                                             IDictionary<string, Interval> variableRanges,
    106106                                             ISymbolicExpressionTree solution) {
    107107      return SymbolicRegressionConstraintAnalyzer.ConstraintSatisfied(constraint, new IntervalInterpreter(),
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMultiSoftConstraintEvaluator.cs

    r17627 r17632  
    120120
    121121      var constraints    = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
    122       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     122      var variableRanges = problemData.VariableRanges.GetDictionary();
    123123
    124124      var objectives          = new List<double> {nmse};
     
    144144
    145145    public static double ConstraintExceeded(IntervalConstraint constraint, IntervalInterpreter intervalInterpreter,
    146                                             IReadOnlyDictionary<string, Interval> variableRanges,
     146                                            IDictionary<string, Interval> variableRanges,
    147147                                            ISymbolicExpressionTree solution /*, bool splitting*/) {
    148148      if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
     
    182182    }
    183183
    184     public static double Normalize(double val, double min = 0, double max = 10e6) {
    185       return (val - min) / (max - min);
    186     }
    187 
    188184    /*
    189185     * First objective is to maximize the Pearson R² value
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs

    r17621 r17632  
    4444
    4545      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
    46       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     46      var variableRanges = problemData.VariableRanges.GetDictionary();
    4747
    4848      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) return 0;
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs

    r17621 r17632  
    4747
    4848      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
    49       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     49      var variableRanges = problemData.VariableRanges.GetDictionary();
    5050      var tree           = solution;
    5151
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionConstraintAnalyzer.cs

    r17611 r17632  
    6363      var results        = ResultCollectionParameter.ActualValue;
    6464      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
    65       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     65      var variableRanges = problemData.VariableRanges.GetDictionary();
    6666      var newDataTable   = ConstraintViolationParameter.ActualValue;
    6767
     
    8282    public static bool ConstraintSatisfied(IntervalConstraint            constraint,
    8383                                           IntervalInterpreter           intervalInterpreter,
    84                                            IReadOnlyDictionary<string, Interval> variableRanges,
     84                                           IDictionary<string, Interval> variableRanges,
    8585                                           ISymbolicExpressionTree       solution) {
    8686      if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
     
    110110
    111111    public static bool ConstraintsSatisfied(IEnumerable<IntervalConstraint> constraints,
    112                                             IReadOnlyDictionary<string, Interval>   variableRanges,
     112                                            IDictionary<string, Interval>   variableRanges,
    113113                                            ISymbolicExpressionTree         solution) {
    114114      var intervalInterpreter = new IntervalInterpreter();
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r17579 r17632  
    200200      var problemData = solution.ProblemData;
    201201      var model = solution.Model;
    202       var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
     202      var variableRanges = problemData.VariableRanges.GetDictionary();
    203203
    204204      intervalEvaluation.AddInterval($"Target {problemData.TargetVariable}", new Interval(variableRanges[problemData.TargetVariable].LowerBound, variableRanges[problemData.TargetVariable].UpperBound));
Note: See TracChangeset for help on using the changeset viewer.