Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/22/11 19:04:54 (14 years ago)
Author:
gkronber
Message:

#1418 unified size/height vs. length/depth terminology and adapted unit tests for symbolic expression tree encoding version 3.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/SubtreeCrossoverTest.cs

    r5445 r5549  
    2424using System.Diagnostics;
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
    27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers;
    2826using HeuristicLab.Random;
    2927using Microsoft.VisualStudio.TestTools.UnitTesting;
    3028
    31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
     29namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._4.Tests {
    3230  [TestClass]
    3331  public class SubtreeCrossoverTest {
     
    5149    public void SubtreeCrossoverDistributionsTest() {
    5250      int generations = 5;
    53       var trees = new List<SymbolicExpressionTree>();
     51      var trees = new List<ISymbolicExpressionTree>();
    5452      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
    5553      var random = new MersenneTwister(31415);
    56       List<SymbolicExpressionTree> crossoverTrees;
     54      List<ISymbolicExpressionTree> crossoverTrees;
    5755      double msPerCrossoverEvent;
    5856
     
    6361      stopwatch.Start();
    6462      for (int gCount = 0; gCount < generations; gCount++) {
    65         var newPopulation = new List<SymbolicExpressionTree>();
     63        var newPopulation = new List<ISymbolicExpressionTree>();
    6664        for (int i = 0; i < POPULATION_SIZE; i++) {
    6765          var par0 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
    6866          var par1 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
    69           bool success;
    70           newPopulation.Add(SubtreeCrossover.Cross(random, par0, par1, 0.9, 100, 10, out success));
    71           Assert.IsTrue(success);
     67          newPopulation.Add(SubtreeCrossover.Cross(random, par0, par1, 0.9, 100, 10));
    7268        }
    7369        crossoverTrees = newPopulation;
Note: See TracChangeset for help on using the changeset viewer.