Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/08 16:00:00 (17 years ago)
Author:
swagner
Message:

Fixed ticket #67

  • adapted accessing of variables in operators due to changes of variable lookup and the new name aliasing mechanism (actual/formal name translations should not be done directly anymore; instead the new method Scope.TranslateName should be used)
Location:
trunk/sources/HeuristicLab.Selection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection/ProportionalSelector.cs

    r2 r77  
    8181      if (subScopes < 1) throw new InvalidOperationException("No source scopes to select available.");
    8282
    83       double best = source.SubScopes[0].GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
    84       double worst = source.SubScopes[subScopes - 1].GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
     83      double best = source.SubScopes[0].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
     84      double worst = source.SubScopes[subScopes - 1].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
    8585      double limit = Math.Min(worst * 2, double.MaxValue);
    8686      double min = Math.Min(best, worst);
     
    9090      // preprocess fitness values, apply windowing if desired
    9191      for (int i = 0; i < qualities.Length; i++) {
    92         solutionQuality = source.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
     92        solutionQuality = source.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
    9393        if (solutionQuality < min || solutionQuality > max) {
    9494          // something has obviously gone wrong here
  • trunk/sources/HeuristicLab.Selection/TournamentSelector.cs

    r2 r77  
    5252        for (int j = 0; j < groupSize; j++) {
    5353          IScope scope = source.SubScopes[random.Next(source.SubScopes.Count)];
    54           double quality = scope.GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
     54          double quality = scope.GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
    5555          if (((maximization) && (quality > best)) ||
    5656              ((!maximization) && (quality < best))) {
Note: See TracChangeset for help on using the changeset viewer.