Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/13 13:13:34 (9 years ago)
Author:
mkommend
Message:

#2021: Fixed a bug node impact caluclation code and adapted the cloner to include a method to get the matching cloned object given the original one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs

    r9456 r9840  
    4949      var replacementValue = CalculateReplacementValue(regressionModel, node, regressionProblemData, rows);
    5050      var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue };
     51
    5152      var cloner = new Cloner();
    52       cloner.RegisterClonedObject(node, constantNode);
    5353      var tempModel = cloner.Clone(regressionModel);
     54      var tempModelNode = (ISymbolicExpressionTreeNode)cloner.GetClone(node);
     55
     56      var tempModelParentNode = tempModelNode.Parent;
     57      int i = tempModelParentNode.IndexOfSubtree(tempModelNode);
     58      tempModelParentNode.RemoveSubtree(i);
     59      tempModelParentNode.InsertSubtree(i, constantNode);
    5460
    5561      var estimatedValues = tempModel.GetEstimatedValues(dataset, rows);
Note: See TracChangeset for help on using the changeset viewer.