Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/19 12:52:44 (5 years ago)
Author:
chaider
Message:

#2971 fixed persisting of problems

  • Attached Storable propperty to backing fields
  • Changed the lazy enumerable of the Constraints field
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ProblemDataConstraint.cs

    r16928 r16935  
    3838                                                  "\u2202²'y'/\u2202'x'² in ]-1 .. inf.[";
    3939
     40    [Storable(Name = "Input")]
    4041    private string input;
    41     [Storable]
    4242    public string Input {
    4343      get => input;
     
    4949    }
    5050
     51    [Storable(Name = "Constraints")]
    5152    private IEnumerable<IntervalConstraint> constraints;
    52     [Storable]
    5353    public IEnumerable<IntervalConstraint> Constraints {
    54       get => constraints;
     54      get => constraints.ToList();
    5555      set {
    5656        if (constraints == value) return;
    57         constraints = value;
     57        constraints = value.ToList();
    5858        OnChanged();
    5959      }
     
    6868      : base(original, cloner) {
    6969      this.Input = original.Input;
    70       this.constraints = original.Constraints.Select(cloner.Clone);
     70      this.constraints = original.Constraints.Select(cloner.Clone).ToList();
    7171      this.ProblemData = cloner.Clone(original.ProblemData);
    7272    }
     
    8484    public ProblemDataConstraint(IRegressionProblemData problemData) : base() {
    8585      this.Input = exampleInput;
    86       this.constraints = new List<IntervalConstraint>();
     86      this.constraints = new CheckedItemList<IntervalConstraint>();
    8787      this.ProblemData = problemData;
    8888    }
Note: See TracChangeset for help on using the changeset viewer.