Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/10 17:31:09 (13 years ago)
Author:
gkronber
Message:

Fixed #1214. The size of the manipulated tree is checked and only if the new tree fulfills the size requirements it is accepted otherwise the original tree is returned instead. Additionally the calculation of tree sizes is checked for overflows now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Util.cs

    r4106 r4524  
    115115
    116116    public static void IsValid(SymbolicExpressionTree tree) {
     117      int reportedSize = tree.Size;
     118      int actualSize = tree.IterateNodesPostfix().Count();
     119      Assert.AreEqual(actualSize, reportedSize);
     120
    117121      foreach (var defunTreeNode in tree.Root.SubTrees.OfType<DefunTreeNode>()) {
    118122        int arity = defunTreeNode.NumberOfArguments;
Note: See TracChangeset for help on using the changeset viewer.