Changeset 6017 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators
- Timestamp:
- 04/17/11 11:03:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmEvaluator.cs
r5655 r6017 1 1 using System; 2 2 using System.Diagnostics; 3 using System.Linq; 3 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Core; 5 6 using HeuristicLab.Data; 7 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 6 8 using HeuristicLab.Operators; 7 9 using HeuristicLab.Optimization; 8 10 using HeuristicLab.Parameters; 9 11 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 10 13 11 14 namespace HeuristicLab.Problems.MetaOptimization { … … 54 57 IAlgorithm algorithm = AlgorithmParameter.ActualValue; 55 58 59 #region Debug Code for SymbolicRegressionGrammar 60 var srp = (SymbolicRegressionSingleObjectiveProblem)algorithm.Problem; 61 //Console.WriteLine("Evaluating Grammar: " + PrintGrammar(srp.SymbolicExpressionTreeGrammar)); 62 #endregion 63 56 64 var sw = new Stopwatch(); 57 65 sw.Start(); 58 66 algorithm.StartSync(); 59 67 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)); 61 69 62 70 RunsParameter.Value = new ItemList<IRun>(algorithm.Runs); … … 72 80 parameterConfiguration.Randomize(random); 73 81 } 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 } 74 90 } 75 91 }
Note: See TracChangeset
for help on using the changeset viewer.