source: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.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.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Dynamic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using System.Windows.Markup;
8using HeuristicLab.Common;
9using HeuristicLab.Core;
10using HeuristicLab.Data;
11using HeuristicLab.Parameters;
12
13namespace HeuristicLab.Problems.DataAnalysis {
14  [Item("ParsedConstraint", "Represents parsed constraints.")]
15  public class ParsedConstraint : Item {
16
17    protected string input;
18    public string Input {
19      get => input;
20      set => input = value;
21    }
22
23    protected IEnumerable<IntervalConstraint> constraints;
24
25    public IEnumerable<IntervalConstraint> Constraints {
26      get => constraints;
27      set => constraints = value;
28    }
29
30    protected string targetVariable;
31    public string TargetVariable {
32      get => targetVariable;
33      set => targetVariable = value;
34    }
35
36    protected IEnumerable<string> allowedVariables;
37
38    public IEnumerable<string> AllowedVariables {
39      get => allowedVariables;
40      set => allowedVariables = value;
41    }
42
43    protected ParsedConstraint(ParsedConstraint original, Cloner cloner)
44      : base(original, cloner) {
45      this.input = original.Input ?? string.Empty;
46      this.constraints = original.Constraints ?? new ItemList<IntervalConstraint>();
47     
48    }
49
50    public override IDeepCloneable Clone(Cloner cloner) {
51      return new ParsedConstraint(this, cloner);
52    }
53
54    public ParsedConstraint() {
55      this.input = string.Empty;
56      this.constraints = new ItemList<IntervalConstraint>();
57    }
58
59    public ParsedConstraint(string input, string targetVariable, IEnumerable<string> allowedVariables) {
60      this.input = input;
61      this.constraints = new ItemList<IntervalConstraint>();
62      this.targetVariable = targetVariable;
63      this.allowedVariables = allowedVariables;
64    }
65
66    public ParsedConstraint(string input, IEnumerable<IntervalConstraint> constraints) {
67      this.input = input;
68      this.constraints = constraints;
69    }
70  }
71}
Note: See TracBrowser for help on using the repository browser.