- Timestamp:
- 05/13/08 15:01:08 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Recombination/SizeFairCrossOver.cs ¶
r189 r238 30 30 using HeuristicLab.Constraints; 31 31 using HeuristicLab.Functions; 32 using System.Diagnostics; 32 33 33 34 namespace HeuristicLab.StructureIdentification { … … 95 96 96 97 // check if the new tree is valid and if the size of is still in the allowed bounds 97 if(!gardener.IsValidTree(newTree) || 98 newTreeHeight > maxTreeHeight || 99 newTreeSize > maxTreeSize) { 100 throw new InvalidProgramException(); 101 } 98 Debug.Assert(gardener.IsValidTree(newTree) && 99 newTreeHeight <= maxTreeHeight && newTreeSize <= maxTreeSize); 102 100 return gardener.CreateInitializationOperation(newBranches, child); 103 101 } … … 165 163 // - go down in tree1 => the tree that is inserted becomes smaller 166 164 // - however we have to get lucky to solve the 'allowed sub-trees' problem 167 if(tree1Height == 1 || (tree0Level >0 && random.Next(2) == 0)) {165 if(tree1Height == 1 || (tree0Level > 0 && random.Next(2) == 0)) { 168 166 // go up in tree0 169 167 tree0Level--;
Note: See TracChangeset
for help on using the changeset viewer.