Changeset 8207 for branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMoveEvaluator.cs
- Timestamp:
- 07/03/12 17:36:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMoveEvaluator.cs
r8206 r8207 78 78 public override IOperation Apply() { 79 79 var evaluator = EvaluatorParameter.ActualValue; 80 var move = (ReplaceBranchMove)MoveParameter.ActualValue.Clone(); 80 81 var move = MoveParameter.ActualValue; 81 82 82 83 // calculate linear scaling … … 88 89 move.Beta = beta; 89 90 90 move.Parent.RemoveSubtree(move.SubtreeIndex); 91 move.Parent.InsertSubtree(move.SubtreeIndex, Scale(move.NewBranch, alpha, beta)); 91 // clone tree and parent 92 var cloner = new Cloner(); 93 var clonedTree = cloner.Clone(move.Tree); 94 var clonedParent = cloner.Clone(move.Parent); 95 var clonedBranch = cloner.Clone(move.NewBranch); 96 97 clonedParent.RemoveSubtree(move.SubtreeIndex); 98 clonedParent.InsertSubtree(move.SubtreeIndex, Scale(clonedBranch, alpha, beta)); 92 99 93 100 var problemData = ProblemDataParameter.ActualValue; … … 96 103 var fitnessPartition = FitnessCalculationPartitionParameter.ActualValue; 97 104 var rows = Enumerable.Range(fitnessPartition.Start, fitnessPartition.End - fitnessPartition.Start); 98 var quality = evaluator.Evaluate(childContext, move.Tree, problemData, rows);105 var quality = evaluator.Evaluate(childContext, clonedTree, problemData, rows); 99 106 100 107 MoveQualityParameter.ActualValue = new DoubleValue(quality);
Note: See TracChangeset
for help on using the changeset viewer.