Changeset 5281 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers
- Timestamp:
- 01/11/11 17:55:30 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestParameterConfigurationAnalyzer.cs
r5212 r5281 14 14 /// TODO An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates. 15 15 /// </summary> 16 [Item("BestParameterConfigurationAnalyzer", " TODO An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")]16 [Item("BestParameterConfigurationAnalyzer", "")] 17 17 [StorableClass] 18 18 public sealed class BestParameterConfigurationAnalyzer : SingleSuccessorOperator, IAnalyzer { … … 39 39 get { return (LookupParameter<RunCollection>)Parameters["Population"]; } 40 40 } 41 42 // stores the medians of the qualities of each problem43 41 public LookupParameter<DoubleArray> ProblemQualityMediansParameter { 44 42 get { return (LookupParameter<DoubleArray>)Parameters["ProblemQualityMedians"]; } … … 50 48 public BestParameterConfigurationAnalyzer() 51 49 : base() { 52 Parameters.Add(new ScopeTreeLookupParameter<ParameterConfigurationTree>("ParameterConfigurationTree", " TODO The TSP solutions given in path representation from which the best solution should be analyzed."));53 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", " TODO The qualities of the TSP solutions which should be analyzed."));54 Parameters.Add(new LookupParameter<IRun>("BestSolution", " TODO The best TSP solution."));55 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", " TODO The result collection where the best TSP solution should be stored."));56 Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", " TODO The quality of the best known solution of this TSP instance."));57 Parameters.Add(new LookupParameter<IRun>("BestKnownSolution", " TODO The best known solution of this TSP instance."));58 Parameters.Add(new LookupParameter<RunCollection>("Population", " TODO The best known solution of this TSP instance."));50 Parameters.Add(new ScopeTreeLookupParameter<ParameterConfigurationTree>("ParameterConfigurationTree", "")); 51 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "")); 52 Parameters.Add(new LookupParameter<IRun>("BestSolution", "")); 53 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "")); 54 Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "")); 55 Parameters.Add(new LookupParameter<IRun>("BestKnownSolution", "")); 56 Parameters.Add(new LookupParameter<RunCollection>("Population", "")); 59 57 Parameters.Add(new LookupParameter<DoubleArray>("ProblemQualityMedians", "")); 60 58 Parameters.Add(new LookupParameter<ConstrainedItemList<ISingleObjectiveProblem>>(MetaOptimizationProblem.ProblemsParameterName)); … … 114 112 } 115 113 116 // medians for the problems117 DoubleArray medians = new DoubleArray(ProblemsParameter.ActualValue.Count);118 for (int pi = 0; pi < ProblemsParameter.ActualValue.Count; pi++) {119 double[] values = new double[rc.Count];120 for (int ri = 0; ri < rc.Count; ri++) {121 values[ri] = ((DoubleArray)rc.ElementAt(ri).Results["RunsAverageQualities"])[pi];122 }123 medians[pi] = values.Median();124 }125 ProblemQualityMediansParameter.ActualValue = medians;126 127 if (results.ContainsKey("ProblemsAverageQualityMedians")) {128 results["ProblemsAverageQualityMedians"].Value = medians;129 } else {130 results.Add(new Result("ProblemsAverageQualityMedians", medians));131 }132 133 114 return base.Apply(); 134 115 }
Note: See TracChangeset
for help on using the changeset viewer.