- Timestamp:
- 08/05/08 16:51:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/TreeGardener.cs
r451 r452 104 104 105 105 internal IFunctionTree PTC2(IRandom random, IFunction rootF, int size, int maxDepth) { 106 if(size <= 1 || maxDepth <= 1) return RandomSelect(terminals).GetTreeNode(); 106 IFunctionTree root = rootF.GetTreeNode(); 107 if(size <= 1 || maxDepth <= 1) return root; 107 108 List<object[]> list = new List<object[]>(); 108 IFunctionTree root = rootF.GetTreeNode();109 110 109 int currentSize = 1; 111 110 int totalListMinSize = 0; … … 167 166 int d = (int)nextExtension[2]; 168 167 parent.RemoveSubTree(a); 169 parent.InsertSubTree(a, CreateRandomTree(GetAllowedSubFunctions(parent.Function, a), 1, 1)); // append a tree with minimal possible height 168 parent.InsertSubTree(a, 169 CreateRandomTree(GetAllowedSubFunctions(parent.Function, a), 1, 1)); // append a tree with minimal possible height 170 170 } 171 171 return root; … … 200 200 // build the tree 201 201 IFunctionTree root; 202 root = PTC2(random, selectedFunction, maxTreeSize - 1, maxTreeHeight - 1);202 root = PTC2(random, selectedFunction, maxTreeSize, maxTreeHeight); 203 203 return root; 204 204 }
Note: See TracChangeset
for help on using the changeset viewer.