Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16935


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
Location:
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalConstraint.cs

    r16932 r16935  
    2828  [Item("Interval Constraint", "Constraint on intervals.")]
    2929  public sealed class IntervalConstraint : Item {
     30    [Storable(Name = "Expression")]
    3031    private string expression;
    31     [Storable]
    3232    public string Expression {
    3333      get => expression;
     
    4545    }
    4646
     47    [Storable(Name = "Variable")]
    4748    private string variable;
    48     [Storable]
    4949    public string Variable {
    5050      get => variable;
     
    5858    }
    5959
     60    [Storable(Name = "Target")]
    6061    private string target;
    61     [Storable]
    6262    public string Target {
    6363      get => target;
     
    7575    }
    7676
     77    [Storable(Name = "NumberOfDerivation")]
    7778    private int numberOfDerivation;
    78     [Storable]
    7979    public int NumberOfDerivation {
    8080      get => numberOfDerivation;
     
    9090    }
    9191
     92    [Storable(Name = "Interval")]
    9293    private Interval interval;
    93     [Storable]
    9494    public Interval Interval {
    9595      get => interval;
     
    102102      }
    103103    }
     104
     105    [Storable(Name = "InclusiveLowerBound")]
    104106    private bool inclusiveLowerBound;
    105     [Storable]
    106107    public bool InclusiveLowerBound {
    107108      get => inclusiveLowerBound;
     
    115116    }
    116117
     118    [Storable(Name = "InclusiveUpperBound")]
    117119    private bool inclusiveUpperBound;
    118     [Storable]
    119120    public bool InclusiveUpperBound {
    120121      get => inclusiveUpperBound;
     
    128129    }
    129130
     131    [Storable(Name = "Enabled")]
    130132    private bool enabled;
    131     [Storable]
    132133    public bool Enabled {
    133134      get => enabled;
  • 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.