[16772] | 1 | using System;
|
---|
| 2 | using System.ComponentModel;
|
---|
| 3 | using System.Drawing;
|
---|
| 4 | using System.Runtime.CompilerServices;
|
---|
| 5 | using HeuristicLab.Common;
|
---|
| 6 | using HeuristicLab.Core;
|
---|
| 7 | using HeuristicLab.Problems.DataAnalysis.Annotations;
|
---|
| 8 | using HEAL.Attic;
|
---|
[16587] | 9 |
|
---|
| 10 | namespace HeuristicLab.Problems.DataAnalysis {
|
---|
[16628] | 11 | [StorableType("8109BE58-CCFB-4462-A2F4-EEE5DFADAFF7")]
|
---|
[16772] | 12 | [Item("Interval Constraint", "Constraint on intervals.")]
|
---|
| 13 | public class IntervalConstraint : Item {
|
---|
[16592] | 14 | public string Expression { get; set; }
|
---|
[16587] | 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; }
|
---|
[16596] | 22 |
|
---|
[16772] | 23 | public IntervalConstraint() {}
|
---|
[16596] | 24 |
|
---|
[16772] | 25 | public IntervalConstraint(string expression, string definition, Interval interval, bool inclusiveLowerBound,
|
---|
| 26 | bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation) {
|
---|
[16596] | 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 | }
|
---|
[16772] | 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 | }
|
---|
[16587] | 59 | }
|
---|
| 60 | }
|
---|