using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Markup; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Parameters; namespace HeuristicLab.Problems.DataAnalysis { [Item("ParsedConstraint", "Represents parsed constraints.")] public class ParsedConstraint : Item { protected string input; public string Input { get => input; set => input = value; } protected IEnumerable constraints; public IEnumerable Constraints { get => constraints; set { constraints = value; OnChanged(EventArgs.Empty); } } protected IRegressionProblemData problemData; public IRegressionProblemData ProblemData { get => problemData; set => problemData = value; } protected ParsedConstraint(ParsedConstraint original, Cloner cloner) : base(original, cloner) { this.input = original.Input ?? string.Empty; this.constraints = original.Constraints ?? new CheckedItemList(); this.problemData = original.problemData; } public override IDeepCloneable Clone(Cloner cloner) { return new ParsedConstraint(this, cloner); } public ParsedConstraint() { this.input = string.Empty; this.constraints = new CheckedItemList(); } public ParsedConstraint(string input, IRegressionProblemData problemData) { this.input = input; this.constraints = new CheckedItemList(); this.problemData = problemData; } public ParsedConstraint(string input, IEnumerable constraints) { this.input = input; this.constraints = constraints; } public event EventHandler Changed; protected virtual void OnChanged(EventArgs e) { EventHandler handlers = Changed; if (handlers != null) handlers(this, e); } } }