Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2855


Ignore:
Timestamp:
02/24/10 10:45:47 (14 years ago)
Author:
gkronber
Message:

Fixed a minor bug in the problem injector. #886 (ProblemInjector doesn't work correctly if actual names of local variables are changed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling/3.2/ProblemInjector.cs

    r2440 r2855  
    108108      scope.AddVariable(new Variable(scope.TranslateName("InputVariables"), inputVariables));
    109109
    110       int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
    111       int trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data;
     110      int trainingStart = ((IntData)GetVariable("TrainingSamplesStart").Value).Data;
     111      int trainingEnd = ((IntData)GetVariable("TrainingSamplesEnd").Value).Data;
    112112
    113113      var maxTraining = GetVariableValue<IntData>("MaxNumberOfTrainingSamples", scope, true, false);
     
    134134      for (int row = 0; row < rows; row++) {
    135135        int column = 0;
    136         values[row*columns + column] = operatorDataset.GetValue(row, targetVariableIndex); // set target variable value to column index 0
     136        values[row * columns + column] = operatorDataset.GetValue(row, targetVariableIndex); // set target variable value to column index 0
    137137        column++; // start input variables at column index 1
    138138        foreach (var inputVariable in operatorAllowedVariables) {
     
    165165
    166166    private void AddVariableToScope(string variableName, IScope scope) {
    167       scope.AddVariable(new Variable(scope.TranslateName(variableName), (IItem)GetVariable(variableName).Value.Clone()));     
     167      scope.AddVariable(new Variable(scope.TranslateName(variableName), (IItem)GetVariable(variableName).Value.Clone()));
    168168    }
    169169  }
Note: See TracChangeset for help on using the changeset viewer.