Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/19 10:04:14 (6 years ago)
Author:
chaider
Message:

#2971 Added AfterDeserialization hook to RegressionProblemData to add VariableRanges and IntervalConstraints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r16800 r16810  
    138138    [StorableHook(HookType.AfterDeserialization)]
    139139    private void AfterDeserialization() {
     140      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
     141      NamedIntervals namedIntervals = new NamedIntervals();
     142      foreach (var variable in variables) {
     143        if (!this.Dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables
     144        var variableInterval = Interval.GetInterval(this.Dataset.GetDoubleValues(variable.Value));
     145        namedIntervals.VariableIntervals.Add(variable.Value, variableInterval);
     146      }
     147
     148      Parameters.Add(new FixedValueParameter<NamedIntervals>(VariableRangesParameterName, namedIntervals));
     149      Parameters.Add(new FixedValueParameter<ParsedConstraint>(IntervalConstraintsParameterName, new ParsedConstraint(this)));
    140150      RegisterParameterEvents();
    141151    }
Note: See TracChangeset for help on using the changeset viewer.