Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16881 for branches


Ignore:
Timestamp:
05/02/19 10:02:13 (6 years ago)
Author:
chaider
Message:

#2971

  • removed unused constructors
  • changed creation of IntervalConstraint in IntervalConstraintParser
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  
    4040
    4141    private string definition;
    42 
    4342    public string Definition {
    4443      get => definition;
     
    9796    }
    9897
    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 
    11498    public IntervalConstraint(string expression, string definition, Interval interval, bool inclusiveLowerBound,
    11599      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  
    5050              var lowerBound = ParseIntervalBounds(match.Groups[4].Value);
    5151              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;
    6163
    6264              yield return constraint;
     
    9496              var lowerBound = ParseIntervalBounds(match.Groups[9].Value);
    9597              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 +
    99100                                      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;
    106110
    107111              yield return constraint;
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs

    r16866 r16881  
    6363    }
    6464
    65     public ParsedConstraint() {
     65    public ParsedConstraint() :base () {
    6666      this.Input = exampleInput;
    6767      this.constraints = new CheckedItemList<IntervalConstraint>();
     
    6969    }
    7070
    71     public ParsedConstraint(IRegressionProblemData problemData) {
     71    public ParsedConstraint(IRegressionProblemData problemData) : base() {
    7272      this.Input = exampleInput;
    7373      this.constraints = new List<IntervalConstraint>();
    7474      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;
    8675    }
    8776
Note: See TracChangeset for help on using the changeset viewer.