Changeset 17506 for branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalConstraint.cs
- Timestamp:
- 04/10/20 14:04:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalConstraint.cs
r17370 r17506 20 20 #endregion 21 21 using System; 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { … … 60 60 public string Target { 61 61 get => target; 62 set {62 private set { 63 63 if (target == value) return; 64 64 target = value; … … 68 68 } 69 69 70 public bool IsDerivati on{71 get => numberOfDerivation> 0;70 public bool IsDerivative { 71 get => NumberOfDerivations > 0; 72 72 } 73 73 74 74 [Storable] 75 private int numberOfDerivation ;76 public int NumberOfDerivation {77 get => numberOfDerivation ;75 private int numberOfDerivations; 76 public int NumberOfDerivations { 77 get => numberOfDerivations; 78 78 set { 79 79 if (value < 0 || value > 3) throw new ArgumentException("Number of derivation has to be between 0 - 3."); 80 if (numberOfDerivation == value) return;81 numberOfDerivation = value;80 if (numberOfDerivations == value) return; 81 numberOfDerivations = value; 82 82 UpdateExpression(); 83 83 OnChanged(); … … 111 111 private IntervalConstraint(StorableConstructorFlag _) : base(_) { } 112 112 113 public IntervalConstraint(string expression, string variable, string target, int numberOfDerivation , Interval interval, bool enabled) : base(){113 public IntervalConstraint(string expression, string variable, string target, int numberOfDerivations, Interval interval, bool enabled) : base(){ 114 114 this.expression = expression; 115 115 this.variable = variable; 116 116 this.target = target; 117 this.numberOfDerivation = numberOfDerivation;117 this.numberOfDerivations = numberOfDerivations; 118 118 this.interval = interval; 119 119 this.enabled = enabled; … … 129 129 this.Variable = original.Variable; 130 130 this.Target = original.Target; 131 this.NumberOfDerivation = original.NumberOfDerivation;131 this.NumberOfDerivations = original.NumberOfDerivations; 132 132 this.Interval = original.Interval; 133 133 this.Enabled = original.Enabled; … … 157 157 var expression = ""; 158 158 159 if (!IsDerivati on) {159 if (!IsDerivative) { 160 160 expression = string.Format("Target:{0} in {1}{2} .. {3}{4}", 161 161 Variable, … … 174 174 Interval?.UpperBound, 175 175 "]", 176 GetDerivationString(numberOfDerivation ));176 GetDerivationString(numberOfDerivations)); 177 177 Expression = expression; 178 178 } 179 179 180 180 private string GetDefinitionString() { 181 if (!IsDerivati on) {181 if (!IsDerivative) { 182 182 return "Target " + Variable; 183 183 } 184 var definition = $"∂{GetDerivationString(numberOfDerivation )}Target/∂{Variable}{GetDerivationString(numberOfDerivation)}";184 var definition = $"∂{GetDerivationString(numberOfDerivations)}Target/∂{Variable}{GetDerivationString(numberOfDerivations)}"; 185 185 return definition; 186 186 }
Note: See TracChangeset
for help on using the changeset viewer.