Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/12/19 07:48:00 (6 years ago)
Author:
chaider
Message:

#2971

  • Added Expression change event
  • Added errorProvider Validation
Location:
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4
Files:
3 edited

Legend:

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

    r16774 r16776  
    1212  [Item("Interval Constraint", "Constraint on intervals.")]
    1313  public class IntervalConstraint : NamedItem {
    14     public string Expression { get; set; }
     14    private string expression;
     15    public string Expression {
     16      get => expression;
     17      set {
     18        if (value != expression) {
     19          expression = value;
     20        }
     21      }
     22    }
    1523    public string Definition { get; set; }
    1624    public Interval Interval { get; set; }
    17     public bool InclusiveLowerBound { get; set; }
     25    private bool inclusiveLowerBound;
     26
     27    public bool InclusiveLowerBound {
     28      get => inclusiveLowerBound;
     29      set {
     30        if (value != inclusiveLowerBound) {
     31          inclusiveLowerBound = value;
     32          OnChanged(EventArgs.Empty);
     33        }
     34      }
     35    }
    1836    public bool InclusiveUpperBound { get; set; }
    1937    public bool IsDerivation { get; set; }
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r16774 r16776  
    181181                           "#double: upperbound of the interval" + Environment.NewLine +
    182182                           "#bracket: open or closed regarding to open or closed interval definition" + Environment.NewLine +
    183                            "#Y2 in [0 .. 1.2]" + Environment.NewLine + Environment.NewLine +
     183                           "#Target:Y2 in [0 .. 1.2]" + Environment.NewLine + Environment.NewLine +
    184184                           "#Constraints on model parameters:" + Environment.NewLine +
    185185                           "#derivation symbol: d or ∂" + Environment.NewLine +
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs

    r16774 r16776  
    2525    public IEnumerable<IntervalConstraint> Constraints {
    2626      get => constraints;
    27       set => constraints = value;
    28     }
     27      set {
     28        constraints = value;
     29        OnChanged(EventArgs.Empty);
     30      }
     31  }
    2932
    3033    protected IRegressionProblemData problemData;
     
    3841      : base(original, cloner) {
    3942      this.input = original.Input ?? string.Empty;
    40       this.constraints = original.Constraints ?? new ItemList<IntervalConstraint>();
     43      this.constraints = original.Constraints ?? new CheckedItemList<IntervalConstraint>();
    4144     
    4245    }
     
    4851    public ParsedConstraint() {
    4952      this.input = string.Empty;
    50       this.constraints = new ItemList<IntervalConstraint>();
     53      this.constraints = new CheckedItemList<IntervalConstraint>();
    5154    }
    5255
    5356    public ParsedConstraint(string input, IRegressionProblemData problemData) {
    5457      this.input = input;
    55       this.constraints = new ItemList<IntervalConstraint>();
     58      this.constraints = new CheckedItemList<IntervalConstraint>();
    5659      this.problemData = problemData;
    5760    }
     
    6164      this.constraints = constraints;
    6265    }
     66
     67    public event EventHandler Changed;
     68    protected virtual void OnChanged(EventArgs e) {
     69      EventHandler handlers = Changed;
     70      if (handlers != null)
     71        handlers(this, e);
     72    }
    6373  }
    6474}
Note: See TracChangeset for help on using the changeset viewer.