Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/11 19:23:18 (13 years ago)
Author:
gkronber
Message:

#1418 minor bug fix in all architecture altering operators test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/AllArchitectureAlteringOperatorsTest.cs

    r5809 r5917  
    7575            var selectedTree = (ISymbolicExpressionTree)trees.SelectRandom(random).Clone();
    7676            var oldTree = (ISymbolicExpressionTree)selectedTree.Clone();
    77             var oldFormatedTree = formatter.Format(oldTree);
    7877            bool success = false;
    7978            int sw = random.Next(6);
     
    8887            stopwatch.Stop();
    8988            if (!success) failedEvents++;
    90             var newFormatedTree = formatter.Format(selectedTree);
    9189            Util.IsValid(selectedTree);
    9290            newTrees.Add(selectedTree);
     
    107105        newTrees.Clear();
    108106      }
    109       var msPerOperation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE / (double)N_ITERATIONS;
     107      var msPerOperation = stopwatch.ElapsedMilliseconds / ((double)POPULATION_SIZE * (double)N_ITERATIONS);
    110108      Console.WriteLine("AllArchitectureAlteringOperators: " + Environment.NewLine +
    111109        "Operations / s: ~" + Math.Round(1000.0 / (msPerOperation)) + "operations / s)" + Environment.NewLine +
    112         "Failed events: " + failedEvents * 100.0 / (double)(POPULATION_SIZE * N_ITERATIONS * 2.0) + "%" + Environment.NewLine +
     110        "Failed events: " + failedEvents * 100.0 / (double)(POPULATION_SIZE * N_ITERATIONS / 2.0) + "%" + Environment.NewLine +
    113111        Util.GetSizeDistributionString(trees, 200, 5) + Environment.NewLine +
    114112        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
     
    117115        );
    118116
    119       Assert.IsTrue(failedEvents * 100.0 / (POPULATION_SIZE * N_ITERATIONS * 2.0) < 25.0); // 75% of architecture operations must succeed
     117      Assert.IsTrue(failedEvents * 100.0 / (POPULATION_SIZE * N_ITERATIONS / 2.0) < 25.0); // 75% of architecture operations must succeed
    120118      Assert.IsTrue(Math.Round(1000.0 / (msPerOperation)) > 1000); // must achieve more than 1000 ops per second
    121119    }
Note: See TracChangeset for help on using the changeset viewer.