Changeset 16900 for branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval
- Timestamp:
- 05/06/19 14:53:28 (6 years ago)
- Location:
- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalConstraint.cs
r16898 r16900 58 58 } 59 59 60 private string target; 61 62 [Storable] 63 public string Target { 64 get => target; 65 set { 66 if (target != value) { 67 target = value; 68 UpdateExpression(); 69 OnChanged(); 70 } 71 } 72 } 73 60 74 public bool IsDerivation { 61 75 get => numberOfDerivation > 0; … … 131 145 private IntervalConstraint(StorableConstructorFlag _) : base(_) { } 132 146 133 public IntervalConstraint(string expression, string variable, int numberOfDerivation, Interval interval, bool inclusiveLowerBound,147 public IntervalConstraint(string expression, string variable, string target, int numberOfDerivation, Interval interval, bool inclusiveLowerBound, 134 148 bool inclusiveUpperBound, bool enabled) : base(){ 135 149 this.expression = expression; 136 150 this.variable = variable; 151 this.target = target; 137 152 this.numberOfDerivation = numberOfDerivation; 138 153 this.interval = interval; … … 149 164 : base(original, cloner) { 150 165 this.Expression = original.Expression; 166 this.Variable = original.Variable; 167 this.Target = original.Target; 168 this.NumberOfDerivation = original.NumberOfDerivation; 151 169 this.Interval = original.Interval; 152 170 this.InclusiveLowerBound = original.InclusiveLowerBound; 153 171 this.InclusiveUpperBound = original.InclusiveUpperBound; 154 this.Variable = original.Variable;155 this.NumberOfDerivation = original.NumberOfDerivation;156 172 this.enabled = original.enabled; 157 173 } … … 181 197 182 198 if (!IsDerivation) { 183 expression = string.Format(" {0} in {1}{2} .. {3}{4}",199 expression = string.Format("Target:{0} in {1}{2} .. {3}{4}", 184 200 Variable, 185 201 (InclusiveLowerBound) ? "[" : "]", … … 190 206 return; 191 207 } 192 expression = string.Format("\u2202{ 5}Target/\u2202{0}{5} in {1}{2} .. {3}{4}",208 expression = string.Format("\u2202{6}{1}/\u2202{0}{6} in {2}{3} .. {4}{5}", 193 209 Variable, 210 Target, 194 211 (InclusiveLowerBound) ? "[" : "]", 195 212 Interval.LowerBound, -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/IntervalConstraintsParser.cs
r16896 r16900 51 51 var upperBound = ParseIntervalBounds(match.Groups[6].Value); 52 52 var expression = "Target:" + match.Groups[0].Value; 53 var definition = "Target " +match.Groups[1].Value.Trim();53 var parsedTarget = match.Groups[1].Value.Trim(); 54 54 var variable = match.Groups[1].Value.Trim(); 55 55 var inclLowerBound = match.Groups[3].Value.Trim() == "["; … … 59 59 var interval = new Interval(lowerBound, upperBound); 60 60 61 var constraint = new IntervalConstraint(expression, variable, numberOfDerivation, interval, inclLowerBound, inclUpperBound, true);61 var constraint = new IntervalConstraint(expression, variable, parsedTarget, numberOfDerivation, interval, inclLowerBound, inclUpperBound, true); 62 62 63 63 yield return constraint; … … 96 96 var upperBound = ParseIntervalBounds(match.Groups[11].Value); 97 97 var expression = match.Groups[0].Value; 98 var definition = match.Groups[1].Value + match.Groups[2].Value + match.Groups[3].Value + 99 match.Groups[4].Value + match.Groups[5].Value + match.Groups[6].Value + match.Groups[7].Value; 98 var parsedTarget = match.Groups[3].Value.Trim(); 100 99 var isDerivation = true; 101 100 var inclLowerBound = match.Groups[8].Value.Trim() == "["; … … 105 104 var interval = new Interval(lowerBound, upperBound); 106 105 107 var constraint = new IntervalConstraint(expression, variable, numberOfDerivation, interval, inclLowerBound, inclUpperBound, true);106 var constraint = new IntervalConstraint(expression, variable, parsedTarget, numberOfDerivation, interval, inclLowerBound, inclUpperBound, true); 108 107 109 108 yield return constraint;
Note: See TracChangeset
for help on using the changeset viewer.