Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/11 11:03:48 (14 years ago)
Author:
cneumuel
Message:

#1215

  • fixed import of existing algorithm
  • moved operators in subfolders
  • extended tests for SymbolicExpressionGrammar
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmEvaluator.cs

    r5655 r6017  
    11using System;
    22using System.Diagnostics;
     3using System.Linq;
    34using HeuristicLab.Common;
    45using HeuristicLab.Core;
    56using HeuristicLab.Data;
     7using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    68using HeuristicLab.Operators;
    79using HeuristicLab.Optimization;
    810using HeuristicLab.Parameters;
    911using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     12using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    1013
    1114namespace HeuristicLab.Problems.MetaOptimization {
     
    5457      IAlgorithm algorithm = AlgorithmParameter.ActualValue;
    5558
     59      #region Debug Code for SymbolicRegressionGrammar
     60      var srp = (SymbolicRegressionSingleObjectiveProblem)algorithm.Problem;
     61      //Console.WriteLine("Evaluating Grammar: " + PrintGrammar(srp.SymbolicExpressionTreeGrammar));
     62      #endregion
     63
    5664      var sw = new Stopwatch();
    5765      sw.Start();
    5866      algorithm.StartSync();
    5967      sw.Stop();
    60       Console.WriteLine("{0},{1}: {2}", ProblemIndexParameter.ActualValue.Value, RepetitionIndexParameter.ActualValue.Value, sw.Elapsed);
     68      Console.WriteLine("{0},{1}: {2} (Grammar: {3})", ProblemIndexParameter.ActualValue.Value, RepetitionIndexParameter.ActualValue.Value, sw.Elapsed, PrintGrammar(srp.SymbolicExpressionTreeGrammar));
    6169
    6270      RunsParameter.Value = new ItemList<IRun>(algorithm.Runs);
     
    7280      parameterConfiguration.Randomize(random);
    7381    }
     82
     83    // for debug purposes, remove later
     84    private static string PrintGrammar(ISymbolicExpressionGrammar grammar) {
     85      return string.Join(string.Empty, grammar.Symbols.Select(x => x.InitialFrequency).ToArray());
     86      //foreach (var symbol in grammar.Symbols) {
     87      //  Console.WriteLine("{0} ({1})", symbol.ToString(), symbol.InitialFrequency);
     88      //}
     89    }
    7490  }
    7591}
Note: See TracChangeset for help on using the changeset viewer.