Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17636


Ignore:
Timestamp:
06/29/20 15:45:24 (4 years ago)
Author:
chaider
Message:

#3076 Changed variable ranges to be readonly

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

    r17632 r17636  
    9191
    9292      var constraints    = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
    93       var variableRanges = problemData.VariableRanges.GetDictionary();
     93      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
    9494
    9595      var objectives = new List<double> {nmse}; //Add r² to resultlist
     
    103103
    104104    private static double ConstraintExceeded(IntervalConstraint constraint, IntervalInterpreter intervalInterpreter,
    105                                              IDictionary<string, Interval> variableRanges,
     105                                             IReadOnlyDictionary<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

    r17632 r17636  
    120120
    121121      var constraints    = problemData.IntervalConstraints.Constraints.Where(c => c.Enabled);
    122       var variableRanges = problemData.VariableRanges.GetDictionary();
     122      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
    123123
    124124      var objectives          = new List<double> {nmse};
     
    144144
    145145    public static double ConstraintExceeded(IntervalConstraint constraint, IntervalInterpreter intervalInterpreter,
    146                                             IDictionary<string, Interval> variableRanges,
     146                                            IReadOnlyDictionary<string, Interval> variableRanges,
    147147                                            ISymbolicExpressionTree solution /*, bool splitting*/) {
    148148      if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
     
    189189      get {
    190190        var objectives = new List<bool> {false};          //First NMSE ==> min
    191         objectives.AddRange(Enumerable.Repeat(false, 3)); //Constraints ==> min
     191        objectives.AddRange(Enumerable.Repeat(false, 2)); //Constraints ==> min
    192192
    193193        return objectives;
  • branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs

    r17632 r17636  
    4444
    4545      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
    46       var variableRanges = problemData.VariableRanges.GetDictionary();
     46      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
    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

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

    r17632 r17636  
    6363      var results        = ResultCollectionParameter.ActualValue;
    6464      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
    65       var variableRanges = problemData.VariableRanges.GetDictionary();
     65      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
    6666      var newDataTable   = ConstraintViolationParameter.ActualValue;
    6767
     
    8282    public static bool ConstraintSatisfied(IntervalConstraint            constraint,
    8383                                           IntervalInterpreter           intervalInterpreter,
    84                                            IDictionary<string, Interval> variableRanges,
     84                                           IReadOnlyDictionary<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                                             IDictionary<string, Interval>   variableRanges,
     112                                            IReadOnlyDictionary<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

    r17632 r17636  
    200200      var problemData = solution.ProblemData;
    201201      var model = solution.Model;
    202       var variableRanges = problemData.VariableRanges.GetDictionary();
     202      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
    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.