Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/14/11 00:41:58 (14 years ago)
Author:
cneumuel
Message:

#1215

  • added NormalCrossover operators
  • renamed MedianQualityAnalyzer to ReferenceQualityAnalyzer
File:
1 edited

Legend:

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

    r5281 r5293  
    4040    }
    4141
    42     public LookupParameter<DoubleArray> ProblemQualityMediansParameter {
    43       get { return (LookupParameter<DoubleArray>)Parameters["ProblemQualityMedians"]; }
     42    public LookupParameter<DoubleArray> ProblemQualityReferencesParameter {
     43      get { return (LookupParameter<DoubleArray>)Parameters["ProblemQualityReferences"]; }
    4444    }
    4545
     
    5555      Parameters.Add(new LookupParameter<ParameterConfigurationTree>("ParameterConfigurationTree", "Missing description."));
    5656      Parameters.Add(new LookupParameter<IntValue>(MetaOptimizationProblem.RepetitionsParameterName, "Number of evaluations on one problem."));
    57       Parameters.Add(new LookupParameter<DoubleArray>("ProblemQualityMedians", ""));
     57      Parameters.Add(new LookupParameter<DoubleArray>("ProblemQualityReferences", ""));
    5858    }
    5959
     
    7272      ParameterConfigurationTree parameterConfiguration = ParameterConfigurationParameter.ActualValue;
    7373
    74       double[] medians;
    75       if (ProblemQualityMediansParameter.ActualValue == null) {
     74      double[] referenceQualities;
     75      if (ProblemQualityReferencesParameter.ActualValue == null) {
    7676        // this is generation zero. no reference qualities for normalization have been calculated yet.
    77         medians = new double[problems.Count];
    78         for (int i = 0; i < medians.Length; i++) {
    79           medians[i] = 1;
     77        referenceQualities = new double[problems.Count];
     78        for (int i = 0; i < referenceQualities.Length; i++) {
     79          referenceQualities[i] = 1;
    8080        }
    8181      } else {
    82         medians = ProblemQualityMediansParameter.ActualValue.ToArray();
     82        referenceQualities = ProblemQualityReferencesParameter.ActualValue.ToArray();
    8383      }
    8484
     
    131131      parameterConfiguration.Runs = (RunCollection)algorithm.Runs.Clone();
    132132
    133       this.QualityParameter.ActualValue = new DoubleValue(NormalizeQualities(parameterConfiguration, medians));
     133      this.QualityParameter.ActualValue = new DoubleValue(NormalizeQualities(parameterConfiguration, referenceQualities));
    134134
    135135      return base.Apply();
    136136    }
    137137
    138     public static double NormalizeQualities(ParameterConfigurationTree parameterConfigurationTree, double[] medians) {
    139       double[] qualitiesNormalized = new double[medians.Length];
    140       for (int i = 0; i < medians.Length; i++) {
    141         qualitiesNormalized[i] = parameterConfigurationTree.AverageQualities[i] / medians[i];
     138    public static double NormalizeQualities(ParameterConfigurationTree parameterConfigurationTree, double[] referenceQualities) {
     139      double[] qualitiesNormalized = new double[referenceQualities.Length];
     140      for (int i = 0; i < referenceQualities.Length; i++) {
     141        qualitiesNormalized[i] = parameterConfigurationTree.AverageQualities[i] / referenceQualities[i];
    142142      }
    143143      parameterConfigurationTree.QualitiesNormalized = new DoubleArray(qualitiesNormalized);
Note: See TracChangeset for help on using the changeset viewer.