Changeset 17911 for trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraintsParser.cs
- Timestamp:
- 03/23/21 15:24:58 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval/ShapeConstraintsParser.cs
r17906 r17911 76 76 private const string weightRegex = @"\s*(weight:\s*(?<weight>\S*))?"; 77 77 public static ShapeConstraint ParseFunctionRangeConstraint(string expr) { 78 if (!expr.StartsWith("f")) throw new ArgumentException($"Invalid function range constraint {expr} (e.g. f in [1..2])" , nameof(expr));78 if (!expr.StartsWith("f")) throw new ArgumentException($"Invalid function range constraint {expr} (e.g. f in [1..2])"); 79 79 var start = "f".Length; 80 80 var end = expr.Length; … … 131 131 return new ShapeConstraint(interval, weight); 132 132 } else 133 throw new ArgumentException($"The inserted target constraint {expr} is not valid.", nameof(expr));133 throw new ArgumentException($"The target constraint {expr} is not valid."); 134 134 } 135 135 public static ShapeConstraint ParseDerivationConstraint(string expr) { … … 161 161 if (enumeratorNumDeriv != "" || denominatorNumDeriv != "") { 162 162 if (enumeratorNumDeriv == "" || denominatorNumDeriv == "") 163 throw new ArgumentException($"Number of derivation has to be written on both sides in {expr}." , nameof(expr));163 throw new ArgumentException($"Number of derivation has to be written on both sides in {expr}."); 164 164 if (enumeratorNumDeriv != denominatorNumDeriv) 165 throw new ArgumentException($"Derivation number is not equal on both sides in {expr}." , nameof(expr));165 throw new ArgumentException($"Derivation number is not equal on both sides in {expr}."); 166 166 } 167 167 … … 193 193 return new ShapeConstraint(variable, numberOfDerivation, interval, weight); 194 194 } else 195 throw new ArgumentException($"The inserted derivation constraint {expr} is not valid.", nameof(expr));195 throw new ArgumentException($"The derivation constraint {expr} is not valid."); 196 196 } 197 197
Note: See TracChangeset
for help on using the changeset viewer.