Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/10 02:02:51 (15 years ago)
Author:
swagner
Message:

Worked on refactoring of algorithm analysis and tracing (#999)

  • added interfaces to specify on which scope level an analyzer can be applied
  • adapted MultiAnalyzer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r3616 r3618  
    7878      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    7979    }
    80     private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    81       get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     80    private ValueParameter<MultiAnalyzer<IPopulationAnalyzer>> AnalyzerParameter {
     81      get { return (ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>)Parameters["Analyzer"]; }
    8282    }
    8383    private ValueParameter<IntValue> MaximumGenerationsParameter {
     
    119119      set { ElitesParameter.Value = value; }
    120120    }
    121     public MultiAnalyzer Analyzer {
     121    public MultiAnalyzer<IPopulationAnalyzer> Analyzer {
    122122      get { return AnalyzerParameter.Value; }
    123123      set { AnalyzerParameter.Value = value; }
     
    140140      get { return selectors; }
    141141    }
    142     private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     142    private PopulationBestAverageWorstQualityAnalyzer qualityAnalyzer;
    143143    #endregion
    144144
     
    153153      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    154154      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
    155       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
     155      Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer<IPopulationAnalyzer>()));
    156156      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    157157
     
    291291    }
    292292    private void InitializeAnalyzers() {
    293       qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     293      qualityAnalyzer = new PopulationBestAverageWorstQualityAnalyzer();
    294294      ParameterizeAnalyzers();
    295295    }
     
    353353      Analyzer.Operators.Add(qualityAnalyzer);
    354354      if (Problem != null) {
    355         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
     355        foreach (IPopulationAnalyzer analyzer in Problem.Operators.OfType<IPopulationAnalyzer>().OrderBy(x => x.Name))
    356356          Analyzer.Operators.Add(analyzer);
    357357      }
Note: See TracChangeset for help on using the changeset viewer.