Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/15 03:01:59 (9 years ago)
Author:
gkronber
Message:

#2283 commit for 'realistic' (same settings for ant and symbreg) experiment

Location:
branches/HeuristicLab.Problems.GrammaticalOptimization/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Main.csproj

    r11849 r11977  
    5656      <Name>HeuristicLab.Algorithms.GrammaticalOptimization</Name>
    5757    </ProjectReference>
     58    <ProjectReference Include="..\HeuristicLab.Common\HeuristicLab.Common.csproj">
     59      <Project>{3A2FBBCB-F9DF-4970-87F3-F13337D941AD}</Project>
     60      <Name>HeuristicLab.Common</Name>
     61    </ProjectReference>
    5862    <ProjectReference Include="..\HeuristicLab.Distributions\HeuristicLab.Distributions.csproj">
    5963      <Project>{31171165-E16F-4A1A-A8AB-25C6AB3A71B9}</Project>
  • branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Program.cs

    r11976 r11977  
    1313using HeuristicLab.Algorithms.GeneticProgramming;
    1414using HeuristicLab.Algorithms.GrammaticalOptimization;
     15using HeuristicLab.Common;
    1516using HeuristicLab.Problems.GrammaticalOptimization;
    1617using HeuristicLab.Problems.GrammaticalOptimization.SymbReg;
     
    3031      // RunGridTest();
    3132      //RunGpGridTest();
    32      RunFunApproxTest();
     33      RunFunApproxTest();
    3334    }
    3435
     
    308309
    309310    private static void RunFunApproxTest() {
    310       const int nReps = 20;
     311      const int nReps = 30;
    311312      const int seed = 31415;
    312313      //const int maxIters = 50000;
     
    314315      var problemFactories = new Func<Tuple<int, int, ISymbolicExpressionTreeProblem>>[]
    315316      {
    316         //() => Tuple.Create(100000, 23,  (ISymbolicExpressionTreeProblem)new SymbolicRegressionPoly10Problem()),
     317        () => Tuple.Create(100000, 23,  (ISymbolicExpressionTreeProblem)new SymbolicRegressionPoly10Problem()),
    317318        () => Tuple.Create(100000, 17, (ISymbolicExpressionTreeProblem)new SantaFeAntProblem()),
    318319        //() => Tuple.Create(50000, 32,(ISymbolicExpressionTreeProblem)new RoyalSymbolProblem()),
     
    330331
    331332      // skip experiments that are already done
    332       foreach (var problemFactory in problemFactories) {
    333         for (int i = 0; i < nReps; i++) {
     333      for (int i = 0; i < nReps; i++) {
     334        foreach (var problemFactory in problemFactories) {
    334335          {
    335336            var solverSeed = rand.Next();
     
    343344
    344345            int iterations = 0;
     346            double bestQuality = double.NegativeInfinity;
    345347            var globalStatistics = new SentenceSetStatistics(prob.BestKnownQuality(maxSize));
    346348            var algName = alg.GetType().Name;
    347349            var probName = prob.GetType().Name;
    348350            alg.SolutionEvaluated += (sentence, quality) => {
     351              bestQuality = Math.Max(bestQuality, quality);
    349352              iterations++;
    350353              globalStatistics.AddSentence(sentence, quality);
     
    357360              if (iterations % 200 == 0) {
    358361                Console.WriteLine("\"{0,25}\" {1} \"{2,25}\" {3}", algName, maxSize, probName, globalStatistics);
     362                if (bestQuality.IsAlmost(1.0)) {
     363                  alg.StopRequested = true;
     364                }
    359365              }
    360366            };
Note: See TracChangeset for help on using the changeset viewer.