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

Last change on this file since 16772 was 16772, checked in by chaider, 11 months ago

#2971 Changed IntervalConstraints View

File size: 2.2 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 : Item {
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 expression, string definition, Interval interval, bool inclusiveLowerBound,
26      bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation) {
27      Expression = expression;
28      Definition = definition;
29      Interval = interval;
30      InclusiveLowerBound = inclusiveLowerBound;
31      InclusiveUpperBound = inclusiveUpperBound;
32      IsDerivation = isDerivation;
33      Variable = variable;
34      NumberOfDerivation = numberOfDerivation;
35    }
36
37    public override IDeepCloneable Clone(Cloner cloner) {
38      return new IntervalConstraint(this, cloner);
39    }
40
41    protected IntervalConstraint(IntervalConstraint original, Cloner cloner)
42      : base(original, cloner) {
43      this.Expression = original.Expression;
44      this.Definition = original.Definition;
45      this.Interval = original.Interval;
46      this.InclusiveLowerBound = original.InclusiveLowerBound;
47      this.InclusiveUpperBound = original.InclusiveUpperBound;
48      this.IsDerivation = original.IsDerivation;
49      this.Variable = original.Variable;
50      this.NumberOfDerivation = NumberOfDerivation;
51    }
52
53    public event EventHandler Changed;
54    protected virtual void OnChanged(EventArgs e) {
55      EventHandler handlers = Changed;
56      if (handlers != null)
57        handlers(this, e);
58    }
59  }
60}
Note: See TracBrowser for help on using the repository browser.