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)
Location:
trunk/sources/HeuristicLab.Selection.OffspringSelection
Files:
2 edited

Legend:

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

    r2 r77  
    6060        double[] qualitiesArray = new double[scope.SubScopes.Count];
    6161        for (int i = 0; i < qualitiesArray.Length; i++)
    62           qualitiesArray[i] = scope.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
     62          qualitiesArray[i] = scope.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
    6363        qualities = new DoubleArrayData(qualitiesArray);
    6464        IVariableInfo parentQualitiesInfo = GetVariableInfo("ParentQualities");
     
    6666          AddVariable(new Variable(parentQualitiesInfo.ActualName, qualities));
    6767        else
    68           scope.AddVariable(new Variable(parentQualitiesInfo.ActualName, qualities));
     68          scope.AddVariable(new Variable(scope.TranslateName(parentQualitiesInfo.FormalName), qualities));
    6969
    7070        CompositeOperation next = new CompositeOperation();
     
    8282          }
    8383          IVariableInfo qualityInfo = GetVariableInfo("Quality");
    84           double child = scope.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.ActualName, false).Data;
     84          double child = scope.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
    8585          double threshold;
    8686
     
    9797          else
    9898            successful = new BoolData(false);
    99           scope.SubScopes[i].AddVariable(new Variable(successfulInfo.ActualName, successful));
     99          scope.SubScopes[i].AddVariable(new Variable(scope.TranslateName(successfulInfo.FormalName), successful));
    100100        }
    101101
     
    105105          RemoveVariable(parentQualitiesInfo.ActualName);
    106106        else
    107           scope.RemoveVariable(parentQualitiesInfo.ActualName);
     107          scope.RemoveVariable(scope.TranslateName(parentQualitiesInfo.FormalName));
    108108
    109109        return null;
  • 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.