[16756] | 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;
|
---|
[16773] | 7 | using System.Windows.Markup;
|
---|
[16756] | 8 | using HeuristicLab.Common;
|
---|
| 9 | using HeuristicLab.Core;
|
---|
| 10 | using HeuristicLab.Data;
|
---|
[16773] | 11 | using HeuristicLab.Parameters;
|
---|
[16778] | 12 | using HEAL.Attic;
|
---|
[16756] | 13 |
|
---|
| 14 | namespace 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 | }
|
---|