- Timestamp:
- 05/02/19 10:02:13 (6 years ago)
- Location:
- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs
r16880 r16881 40 40 41 41 private string definition; 42 43 42 public string Definition { 44 43 get => definition; … … 97 96 } 98 97 99 public IntervalConstraint() {100 name = "Empty";101 expression = "Empty";102 Interval = new Interval(0, 0);103 inclusiveLowerBound = true;104 inclusiveLowerBound = true;105 IsDerivation = false;106 enabled = false;107 }108 109 public IntervalConstraint(string name) {110 base.name = name;111 enabled = true;112 }113 114 98 public IntervalConstraint(string expression, string definition, Interval interval, bool inclusiveLowerBound, 115 99 bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation, bool isChecked) { -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraintsParser.cs
r16879 r16881 50 50 var lowerBound = ParseIntervalBounds(match.Groups[4].Value); 51 51 var upperBound = ParseIntervalBounds(match.Groups[6].Value); 52 var constraint = new IntervalConstraint("Target:" + match.Groups[0].Value); 53 constraint.Expression = "Target:" + match.Groups[0].Value; 54 constraint.Definition = "Target " + match.Groups[1].Value.Trim(); 55 constraint.Variable = match.Groups[1].Value.Trim(); 56 constraint.InclusiveLowerBound = match.Groups[3].Value.Trim() == "["; 57 constraint.InclusiveUpperBound = match.Groups[7].Value.Trim() == "]"; 58 constraint.IsDerivation = false; 59 constraint.NumberOfDerivation = 0; 60 constraint.Interval = new Interval(lowerBound, upperBound); 52 var expression = "Target:" + match.Groups[0].Value; 53 var definition = "Target " + match.Groups[1].Value.Trim(); 54 var variable = match.Groups[1].Value.Trim(); 55 var inclLowerBound = match.Groups[3].Value.Trim() == "["; 56 var inclUpperBound = match.Groups[7].Value.Trim() == "]"; 57 var isDerivation = false; 58 var numberOfDerivation = 0; 59 var interval = new Interval(lowerBound, upperBound); 60 61 var constraint = new IntervalConstraint(expression, definition, interval, inclLowerBound, inclUpperBound, isDerivation, variable, numberOfDerivation, true); 62 constraint.Name = expression; 61 63 62 64 yield return constraint; … … 94 96 var lowerBound = ParseIntervalBounds(match.Groups[9].Value); 95 97 var upperBound = ParseIntervalBounds(match.Groups[11].Value); 96 var constraint = new IntervalConstraint(match.Groups[0].Value); 97 constraint.Expression = match.Groups[0].Value; 98 constraint.Definition = match.Groups[1].Value + match.Groups[2].Value + match.Groups[3].Value + 98 var expression = match.Groups[0].Value; 99 var definition = match.Groups[1].Value + match.Groups[2].Value + match.Groups[3].Value + 99 100 match.Groups[4].Value + match.Groups[5].Value + match.Groups[6].Value + match.Groups[7].Value; 100 constraint.IsDerivation = true; 101 constraint.InclusiveLowerBound = match.Groups[8].Value.Trim() == "["; 102 constraint.InclusiveUpperBound = match.Groups[12].Value.Trim() == "]"; 103 constraint.Variable = match.Groups[6].Value.Trim(); 104 constraint.NumberOfDerivation = ParseDerivationCount(match.Groups[2].Value.Trim()); 105 constraint.Interval = new Interval(lowerBound, upperBound); 101 var isDerivation = true; 102 var inclLowerBound = match.Groups[8].Value.Trim() == "["; 103 var inclUpperBound = match.Groups[12].Value.Trim() == "]"; 104 var variable = match.Groups[6].Value.Trim(); 105 var numberOfDerivation = ParseDerivationCount(match.Groups[2].Value.Trim()); 106 var interval = new Interval(lowerBound, upperBound); 107 108 var constraint = new IntervalConstraint(expression, definition, interval, inclLowerBound, inclUpperBound, isDerivation, variable, numberOfDerivation, true); 109 constraint.Name = expression; 106 110 107 111 yield return constraint; -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs
r16866 r16881 63 63 } 64 64 65 public ParsedConstraint() {65 public ParsedConstraint() :base () { 66 66 this.Input = exampleInput; 67 67 this.constraints = new CheckedItemList<IntervalConstraint>(); … … 69 69 } 70 70 71 public ParsedConstraint(IRegressionProblemData problemData) {71 public ParsedConstraint(IRegressionProblemData problemData) : base() { 72 72 this.Input = exampleInput; 73 73 this.constraints = new List<IntervalConstraint>(); 74 74 this.ProblemData = problemData; 75 }76 77 public ParsedConstraint(string input, IRegressionProblemData problemData) {78 this.Input = input;79 this.constraints = new CheckedItemList<IntervalConstraint>();80 this.ProblemData = problemData;81 }82 83 public ParsedConstraint(string input, IEnumerable<IntervalConstraint> constraints) {84 this.Input = input;85 this.constraints = constraints;86 75 } 87 76
Note: See TracChangeset
for help on using the changeset viewer.