Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs @ 16778

Last change on this file since 16778 was 16778, checked in by chaider, 5 years ago

#2971

  • Changed field numberOfDerivation
  • Added numberOfDerivation to Expression string
  • Added numberOfDerivation to parser
File size: 2.2 KB
RevLine 
[16756]1using System;
2using System.Collections.Generic;
3using System.Dynamic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
[16773]7using System.Windows.Markup;
[16756]8using HeuristicLab.Common;
9using HeuristicLab.Core;
10using HeuristicLab.Data;
[16773]11using HeuristicLab.Parameters;
[16778]12using HEAL.Attic;
[16756]13
14namespace HeuristicLab.Problems.DataAnalysis {
[16778]15  [StorableType("A56BFB05-8F11-4766-9FBF-20C7010F1CA3")]
[16756]16  [Item("ParsedConstraint", "Represents parsed constraints.")]
17  public class ParsedConstraint : Item {
18
19    protected string input;
20    public string Input {
21      get => input;
22      set => input = value;
23    }
24
25    protected IEnumerable<IntervalConstraint> constraints;
26    public IEnumerable<IntervalConstraint> Constraints {
27      get => constraints;
[16776]28      set {
29        constraints = value;
30        OnChanged(EventArgs.Empty);
31      }
32  }
[16756]33
[16774]34    protected IRegressionProblemData problemData;
35    public IRegressionProblemData ProblemData {
36      get => problemData;
37      set => problemData = value;
[16773]38    }
39
[16756]40    protected ParsedConstraint(ParsedConstraint original, Cloner cloner)
41      : base(original, cloner) {
[16759]42      this.input = original.Input ?? string.Empty;
[16776]43      this.constraints = original.Constraints ?? new CheckedItemList<IntervalConstraint>();
[16777]44      this.problemData = original.problemData;
[16756]45    }
46
47    public override IDeepCloneable Clone(Cloner cloner) {
48      return new ParsedConstraint(this, cloner);
49    }
50
51    public ParsedConstraint() {
52      this.input = string.Empty;
[16776]53      this.constraints = new CheckedItemList<IntervalConstraint>();
[16756]54    }
55
[16774]56    public ParsedConstraint(string input, IRegressionProblemData problemData) {
[16759]57      this.input = input;
[16776]58      this.constraints = new CheckedItemList<IntervalConstraint>();
[16774]59      this.problemData = problemData;
[16759]60    }
61
[16756]62    public ParsedConstraint(string input, IEnumerable<IntervalConstraint> constraints) {
63      this.input = input;
64      this.constraints = constraints;
65    }
[16776]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    }
[16756]73  }
74}
Note: See TracBrowser for help on using the repository browser.