Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/03/11 13:47:16 (13 years ago)
Author:
gkronber
Message:

Improved test cases for symbolic expression tree encoding and fixed minor bugs. #1336

File:
1 edited

Legend:

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

    r4722 r5411  
    130130      }
    131131      //Assert.AreEqual(tree.Root.Symbol, tree.Root.Grammar.StartSymbol);
    132       //foreach (var subtree in tree.Root.SubTrees)
    133       //  Assert.AreNotSame(subtree.Grammar, tree.Root.Grammar);
     132      foreach (var subtree in tree.Root.SubTrees)
     133        Assert.AreNotSame(subtree.Grammar, tree.Root.Grammar);
    134134      IsValid(tree.Root);
    135135    }
     
    141141      Assert.IsTrue(treeNode.SubTrees.Count >= treeNode.Grammar.GetMinSubtreeCount(matchingSymbol));
    142142      Assert.IsTrue(treeNode.SubTrees.Count <= treeNode.Grammar.GetMaxSubtreeCount(matchingSymbol));
     143      Assert.AreNotEqual(0.0, matchingSymbol.InitialFrequency); // check that no deactivated symbols occur in the tree
    143144      for (int i = 0; i < treeNode.SubTrees.Count; i++) {
    144145        Assert.IsTrue(treeNode.GetAllowedSymbols(i).Select(x => x.Name).Contains(treeNode.SubTrees[i].Symbol.Name));
Note: See TracChangeset for help on using the changeset viewer.