Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16927


Ignore:
Timestamp:
05/08/19 15:55:01 (6 years ago)
Author:
chaider
Message:

#2971 use methodes to operate on IntervalCollection dictionary

Location:
branches/2971_named_intervals
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionConstraintAnalyzer.cs

    r16921 r16927  
    7272      var results = ResultCollectionParameter.ActualValue;
    7373      var constraints = problemData.IntervalConstraints.Constraints.Where(x => x.Enabled);
    74       var variableRanges = problemData.VariableRanges.getIntervals();
     74      var variableRanges = problemData.VariableRanges.GetIntervals();
    7575
    7676      if (!results.ContainsKey(ConstraintViolationsResultName)) {
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r16921 r16927  
    1 #region License Information
     1#region License Information
    22/* HeuristicLab
    33 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     
    179179      var problemData = solution.ProblemData;
    180180      var model = solution.Model;
    181       var variableRanges = problemData.VariableRanges.getIntervals();
     181      var variableRanges = problemData.VariableRanges.GetIntervals();
    182182
    183       intervalEvaluation.VariableIntervals.Add($"Target {problemData.TargetVariable}", new Interval(variableRanges[problemData.TargetVariable].LowerBound, variableRanges[problemData.TargetVariable].UpperBound));
    184       intervalEvaluation.VariableIntervals.Add("Model Interval", interpreter.GetSymbolicExpressionTreeInterval(model.SymbolicExpressionTree, variableRanges));
    185 
     183      intervalEvaluation.AddInterval($"Target {problemData.TargetVariable}", new Interval(variableRanges[problemData.TargetVariable].LowerBound, variableRanges[problemData.TargetVariable].UpperBound));
     184      intervalEvaluation.AddInterval("Model Interval", interpreter.GetSymbolicExpressionTreeInterval(model.SymbolicExpressionTree, variableRanges));
    186185      foreach (var inputVariable in model.VariablesUsedForPrediction.OrderBy(v => v, new NaturalStringComparer())) {
    187186        var derivedModel = DerivativeCalculator.Derive(model.SymbolicExpressionTree, inputVariable);
    188187        var derivedResultInterval = interpreter.GetSymbolicExpressionTreeInterval(derivedModel, variableRanges);
    189188
    190         intervalEvaluation.VariableIntervals.Add(" \u2202f/\u2202" + inputVariable,
     189        intervalEvaluation.AddInterval(" ∂f/∂" + inputVariable,
    191190          new Interval(derivedResultInterval.LowerBound, derivedResultInterval.UpperBound));
    192191      }
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs

    r16921 r16927  
    213213      if (regressionProblemData != null) {
    214214        var interpreter = new IntervalInterpreter();
    215         var variableRanges = regressionProblemData.VariableRanges.getIntervals();
     215        var variableRanges = regressionProblemData.VariableRanges.GetIntervals();
    216216        IDictionary<ISymbolicExpressionTreeNode, Interval> intervals;
    217217        interpreter.GetSymbolicExpressionTreeIntervals(tree, variableRanges, out intervals);
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.cs

    r16921 r16927  
    6969
    7070
    71       var variablesCount = Content.getIntervals().Count;
     71      var variablesCount = Content.GetIntervals().Count;
    7272
    7373      DataGridViewRow[] rows = new DataGridViewRow[variablesCount];
     
    9393      for (var i = 0; i < dataGridView.RowCount; ++i) {
    9494        var key = (string)dataGridView.Rows[i].HeaderCell.Value;
    95         dataGridView.Rows[i].Cells[0].Value = Content.getInterval(key).LowerBound;
    96         dataGridView.Rows[i].Cells[1].Value = Content.getInterval(key).UpperBound;
     95        dataGridView.Rows[i].Cells[0].Value = Content.GetInterval(key).LowerBound;
     96        dataGridView.Rows[i].Cells[1].Value = Content.GetInterval(key).UpperBound;
    9797      }
    9898    }
    9999
    100100    private void SetRowsHeader() {
    101       for (var i = 0; i < Content.getIntervals().Count; ++i) {
    102         var item = Content.getIntervals().ElementAt(i);
     101      for (var i = 0; i < Content.GetIntervals().Count; ++i) {
     102        var item = Content.GetIntervals().ElementAt(i);
    103103        dataGridView.Rows[i].HeaderCell.Value = item.Key;
    104104      }
     
    115115      if (e.ColumnIndex < 0 || e.RowIndex < 0) return;
    116116
    117       var lowerBound = e.ColumnIndex == 0 ? double.Parse(dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) : Content.getInterval(key).LowerBound;
    118       var upperBound = e.ColumnIndex == 1 ? double.Parse(dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) : Content.getInterval(key).UpperBound;
     117      var lowerBound = e.ColumnIndex == 0 ? double.Parse(dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) : Content.GetInterval(key).LowerBound;
     118      var upperBound = e.ColumnIndex == 1 ? double.Parse(dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) : Content.GetInterval(key).UpperBound;
    119119
    120120      // update if there was a change
    121       if (lowerBound != Content.getInterval(key).LowerBound ||
    122         upperBound != Content.getInterval(key).UpperBound)
    123         Content.VariableIntervals[key] = new Interval(lowerBound, upperBound);
     121      if (lowerBound != Content.GetInterval(key).LowerBound ||
     122        upperBound != Content.GetInterval(key).UpperBound)
     123        Content.SetInterval(key, new Interval(lowerBound, upperBound));
    124124    }
    125125
Note: See TracChangeset for help on using the changeset viewer.