Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/08 20:28:26 (16 years ago)
Author:
gkronber
Message:

fixed #119

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Manipulation/DeleteSubTreeManipulation.cs

    r155 r163  
    6060      if(parent == null) {
    6161        IFunctionTree newTree = gardener.CreateRandomTree(1, 1, false);
    62 
    6362        // check if the tree is ok
    6463        if(!gardener.IsValidTree(newTree)) {
    6564          throw new InvalidOperationException();
    6665        }
    67 
    6866        // update sizes to match the new tree
    6967        GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(newTree);
     
    9189          throw new InvalidOperationException();
    9290        }
    93 
    9491        GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);
    9592        GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);
     
    9996        // replace with a minimal random seedling
    10097        parent.RemoveSubTree(childIndex);
    101 
    10298        ICollection<IFunction> allowedFunctions = gardener.GetAllowedSubFunctions(parent.Function, childIndex);
    103         IFunctionTree newFunctionTree = gardener.CreateRandomTree(allowedFunctions, 1, 1, true);
    104 
     99        IFunctionTree newFunctionTree = gardener.CreateRandomTree(allowedFunctions, 1, 1);
    105100        parent.InsertSubTree(childIndex, newFunctionTree);
    106 
    107101        if(!gardener.IsValidTree(root)) {
    108102          throw new InvalidProgramException();
    109103        }
    110 
    111104        GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);
    112105        GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);
Note: See TracChangeset for help on using the changeset viewer.