Changeset 3618 for trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm
- Timestamp:
- 05/05/10 02:02:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r3616 r3618 78 78 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 79 79 } 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"]; } 82 82 } 83 83 private ValueParameter<IntValue> MaximumGenerationsParameter { … … 119 119 set { ElitesParameter.Value = value; } 120 120 } 121 public MultiAnalyzer Analyzer {121 public MultiAnalyzer<IPopulationAnalyzer> Analyzer { 122 122 get { return AnalyzerParameter.Value; } 123 123 set { AnalyzerParameter.Value = value; } … … 140 140 get { return selectors; } 141 141 } 142 private BestAverageWorstQualityAnalyzer qualityAnalyzer;142 private PopulationBestAverageWorstQualityAnalyzer qualityAnalyzer; 143 143 #endregion 144 144 … … 153 153 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 154 154 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>())); 156 156 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000))); 157 157 … … 291 291 } 292 292 private void InitializeAnalyzers() { 293 qualityAnalyzer = new BestAverageWorstQualityAnalyzer();293 qualityAnalyzer = new PopulationBestAverageWorstQualityAnalyzer(); 294 294 ParameterizeAnalyzers(); 295 295 } … … 353 353 Analyzer.Operators.Add(qualityAnalyzer); 354 354 if (Problem != null) { 355 foreach (I Analyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))355 foreach (IPopulationAnalyzer analyzer in Problem.Operators.OfType<IPopulationAnalyzer>().OrderBy(x => x.Name)) 356 356 Analyzer.Operators.Add(analyzer); 357 357 }
Note: See TracChangeset
for help on using the changeset viewer.