source: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs @ 16773

Last change on this file since 16773 was 16773, checked in by chaider, 10 months ago

#2971

  • Fixes and updates in IntervalConstraintView
  • Changed Parser
File size: 2.3 KB
Line 
1using System;
2using System.ComponentModel;
3using System.Drawing;
4using System.Runtime.CompilerServices;
5using HeuristicLab.Common;
6using HeuristicLab.Core;
7using HeuristicLab.Problems.DataAnalysis.Annotations;
8using HEAL.Attic;
9
10namespace HeuristicLab.Problems.DataAnalysis {
11  [StorableType("8109BE58-CCFB-4462-A2F4-EEE5DFADAFF7")]
12  [Item("Interval Constraint", "Constraint on intervals.")]
13  public class IntervalConstraint : NamedItem {
14    public string Expression { get; set; }
15    public string Definition { get; set; }
16    public Interval Interval { get; set; }
17    public bool InclusiveLowerBound { get; set; }
18    public bool InclusiveUpperBound { get; set; }
19    public bool IsDerivation { get; set; }
20    public string Variable { get; set; }
21    public int NumberOfDerivation { get; set; }
22
23    public IntervalConstraint() {}
24
25    public IntervalConstraint(string name) {
26      base.name = name;
27    }
28
29    public IntervalConstraint(string expression, string definition, Interval interval, bool inclusiveLowerBound,
30      bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation) {
31      base.name = expression;
32      Expression = expression;
33      Definition = definition;
34      Interval = interval;
35      InclusiveLowerBound = inclusiveLowerBound;
36      InclusiveUpperBound = inclusiveUpperBound;
37      IsDerivation = isDerivation;
38      Variable = variable;
39      NumberOfDerivation = numberOfDerivation;
40    }
41
42    public override IDeepCloneable Clone(Cloner cloner) {
43      return new IntervalConstraint(this, cloner);
44    }
45
46    protected IntervalConstraint(IntervalConstraint original, Cloner cloner)
47      : base(original, cloner) {
48      this.Expression = original.Expression;
49      this.Definition = original.Definition;
50      this.Interval = original.Interval;
51      this.InclusiveLowerBound = original.InclusiveLowerBound;
52      this.InclusiveUpperBound = original.InclusiveUpperBound;
53      this.IsDerivation = original.IsDerivation;
54      this.Variable = original.Variable;
55      this.NumberOfDerivation = NumberOfDerivation;
56    }
57
58    public event EventHandler Changed;
59    protected virtual void OnChanged(EventArgs e) {
60      EventHandler handlers = Changed;
61      if (handlers != null)
62        handlers(this, e);
63    }
64  }
65}
Note: See TracBrowser for help on using the repository browser.