Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/08 16:00:00 (16 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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringSelector.cs

    r40 r77  
    5757          AddVariable(new Variable(goodChildrenInfo.ActualName, goodChildren));
    5858        else
    59           scope.AddVariable(new Variable(goodChildrenInfo.ActualName, goodChildren));
     59          scope.AddVariable(new Variable(scope.TranslateName(goodChildrenInfo.FormalName), goodChildren));
    6060      }
    6161      ItemList<IScope> badChildren = GetVariableValue<ItemList<IScope>>("BadChildren", scope, false, false);
     
    6666          AddVariable(new Variable(badChildrenInfo.ActualName, badChildren));
    6767        else
    68           scope.AddVariable(new Variable(badChildrenInfo.ActualName, badChildren));
     68          scope.AddVariable(new Variable(scope.TranslateName(badChildrenInfo.FormalName), badChildren));
    6969      }
    7070
     
    7373      while (children.SubScopes.Count > 0) {
    7474        IScope child = children.SubScopes[0];
    75         bool successful = child.GetVariableValue<BoolData>(successfulInfo.ActualName, false).Data;
     75        bool successful = child.GetVariableValue<BoolData>(successfulInfo.FormalName, false).Data;
    7676        if (successful) goodChildren.Add(child);
    7777        else badChildren.Add(child);
     
    8787          AddVariable(new Variable(selectionPressureInfo.ActualName, selectionPressure));
    8888        else
    89           scope.AddVariable(new Variable(selectionPressureInfo.ActualName, selectionPressure));
     89          scope.AddVariable(new Variable(scope.TranslateName(selectionPressureInfo.FormalName), selectionPressure));
    9090      }
    9191      DoubleData successRatio = GetVariableValue<DoubleData>("SuccessRatio", scope, false, false);
     
    9696          AddVariable(new Variable(successRatioInfo.ActualName, successRatio));
    9797        else
    98           scope.AddVariable(new Variable(successRatioInfo.ActualName, successRatio));
     98          scope.AddVariable(new Variable(scope.TranslateName(successRatioInfo.FormalName), successRatio));
    9999      }
    100100      int goodCount = goodChildren.Count;
     
    130130          RemoveVariable(goodChildrenInfo.ActualName);
    131131        else
    132           scope.RemoveVariable(goodChildrenInfo.ActualName);
     132          scope.RemoveVariable(scope.TranslateName(goodChildrenInfo.FormalName));
    133133        IVariableInfo badChildrenInfo = GetVariableInfo("BadChildren");
    134134        if (badChildrenInfo.Local)
    135135          RemoveVariable(badChildrenInfo.ActualName);
    136136        else
    137           scope.RemoveVariable(badChildrenInfo.ActualName);
     137          scope.RemoveVariable(scope.TranslateName(badChildrenInfo.FormalName));
    138138
    139139        return null;
Note: See TracChangeset for help on using the changeset viewer.