1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Dynamic;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Text;
|
---|
6 | using System.Threading.Tasks;
|
---|
7 | using System.Windows.Markup;
|
---|
8 | using HeuristicLab.Common;
|
---|
9 | using HeuristicLab.Core;
|
---|
10 | using HeuristicLab.Data;
|
---|
11 | using HeuristicLab.Parameters;
|
---|
12 | using HEAL.Attic;
|
---|
13 |
|
---|
14 | namespace HeuristicLab.Problems.DataAnalysis {
|
---|
15 | [StorableType("A56BFB05-8F11-4766-9FBF-20C7010F1CA3")]
|
---|
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;
|
---|
28 | set {
|
---|
29 | constraints = value;
|
---|
30 | OnChanged(EventArgs.Empty);
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | protected IRegressionProblemData problemData;
|
---|
35 | public IRegressionProblemData ProblemData {
|
---|
36 | get => problemData;
|
---|
37 | set => problemData = value;
|
---|
38 | }
|
---|
39 |
|
---|
40 | protected ParsedConstraint(ParsedConstraint original, Cloner cloner)
|
---|
41 | : base(original, cloner) {
|
---|
42 | this.input = original.Input ?? string.Empty;
|
---|
43 | this.constraints = original.Constraints ?? new CheckedItemList<IntervalConstraint>();
|
---|
44 | this.problemData = original.problemData;
|
---|
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;
|
---|
53 | this.constraints = new CheckedItemList<IntervalConstraint>();
|
---|
54 | }
|
---|
55 |
|
---|
56 | public ParsedConstraint(string input, IRegressionProblemData problemData) {
|
---|
57 | this.input = input;
|
---|
58 | this.constraints = new CheckedItemList<IntervalConstraint>();
|
---|
59 | this.problemData = problemData;
|
---|
60 | }
|
---|
61 |
|
---|
62 | public ParsedConstraint(string input, IEnumerable<IntervalConstraint> constraints) {
|
---|
63 | this.input = input;
|
---|
64 | this.constraints = constraints;
|
---|
65 | }
|
---|
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 | }
|
---|
73 | }
|
---|
74 | }
|
---|