Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs @ 3672

Last change on this file since 3672 was 3672, checked in by abeham, 14 years ago

#999

  • updated OSGA
File size: 23.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using HeuristicLab.Analysis;
26using HeuristicLab.Core;
27using HeuristicLab.Data;
28using HeuristicLab.Optimization;
29using HeuristicLab.Optimization.Operators;
30using HeuristicLab.Parameters;
31using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
32using HeuristicLab.PluginInfrastructure;
33using HeuristicLab.Random;
34using HeuristicLab.Common;
35
36namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm {
37  /// <summary>
38  /// An offspring selection genetic algorithm.
39  /// </summary>
40  [Item("Offspring Selection Genetic Algorithm", "An offspring selection genetic algorithm (Affenzeller, M. et al. 2009. Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications. CRC Press).")]
41  [Creatable("Algorithms")]
42  [StorableClass]
43  public sealed class OffspringSelectionGeneticAlgorithm : EngineAlgorithm {
44    #region Problem Properties
45    public override Type ProblemType {
46      get { return typeof(ISingleObjectiveProblem); }
47    }
48    public new ISingleObjectiveProblem Problem {
49      get { return (ISingleObjectiveProblem)base.Problem; }
50      set { base.Problem = value; }
51    }
52    #endregion
53
54    #region Parameter Properties
55    private ValueParameter<IntValue> SeedParameter {
56      get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
57    }
58    private ValueParameter<BoolValue> SetSeedRandomlyParameter {
59      get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
60    }
61    private ValueParameter<IntValue> PopulationSizeParameter {
62      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
63    }
64    private ConstrainedValueParameter<ISelector> SelectorParameter {
65      get { return (ConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
66    }
67    private ConstrainedValueParameter<ICrossover> CrossoverParameter {
68      get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
69    }
70    private ValueParameter<PercentValue> MutationProbabilityParameter {
71      get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; }
72    }
73    private OptionalConstrainedValueParameter<IManipulator> MutatorParameter {
74      get { return (OptionalConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
75    }
76    private ValueParameter<IntValue> ElitesParameter {
77      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
78    }
79    private ValueParameter<IntValue> MaximumGenerationsParameter {
80      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
81    }
82    private ValueLookupParameter<DoubleValue> SuccessRatioParameter {
83      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
84    }
85    private ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {
86      get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorLowerBound"]; }
87    }
88    private ValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter {
89      get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; }
90    }
91    private OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier> ComparisonFactorModifierParameter {
92      get { return (OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ComparisonFactorModifier"]; }
93    }
94    private ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
95      get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
96    }
97    private ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
98      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
99    }
100    private ValueLookupParameter<IntValue> SelectedParentsParameter {
101      get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; }
102    }
103    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
104      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
105    }
106    #endregion
107
108    #region Properties
109    public IntValue Seed {
110      get { return SeedParameter.Value; }
111      set { SeedParameter.Value = value; }
112    }
113    public BoolValue SetSeedRandomly {
114      get { return SetSeedRandomlyParameter.Value; }
115      set { SetSeedRandomlyParameter.Value = value; }
116    }
117    public IntValue PopulationSize {
118      get { return PopulationSizeParameter.Value; }
119      set { PopulationSizeParameter.Value = value; }
120    }
121    public ISelector Selector {
122      get { return SelectorParameter.Value; }
123      set { SelectorParameter.Value = value; }
124    }
125    public ICrossover Crossover {
126      get { return CrossoverParameter.Value; }
127      set { CrossoverParameter.Value = value; }
128    }
129    public PercentValue MutationProbability {
130      get { return MutationProbabilityParameter.Value; }
131      set { MutationProbabilityParameter.Value = value; }
132    }
133    public IManipulator Mutator {
134      get { return MutatorParameter.Value; }
135      set { MutatorParameter.Value = value; }
136    }
137    public IntValue Elites {
138      get { return ElitesParameter.Value; }
139      set { ElitesParameter.Value = value; }
140    }
141    public IntValue MaximumGenerations {
142      get { return MaximumGenerationsParameter.Value; }
143      set { MaximumGenerationsParameter.Value = value; }
144    }
145    public DoubleValue SuccessRatio {
146      get { return SuccessRatioParameter.Value; }
147      set { SuccessRatioParameter.Value = value; }
148    }
149    public DoubleValue ComparisonFactorLowerBound {
150      get { return ComparisonFactorLowerBoundParameter.Value; }
151      set { ComparisonFactorLowerBoundParameter.Value = value; }
152    }
153    public DoubleValue ComparisonFactorUpperBound {
154      get { return ComparisonFactorUpperBoundParameter.Value; }
155      set { ComparisonFactorUpperBoundParameter.Value = value; }
156    }
157    public IDiscreteDoubleValueModifier ComparisonFactorModifier {
158      get { return ComparisonFactorModifierParameter.Value; }
159      set { ComparisonFactorModifierParameter.Value = value; }
160    }
161    public DoubleValue MaximumSelectionPressure {
162      get { return MaximumSelectionPressureParameter.Value; }
163      set { MaximumSelectionPressureParameter.Value = value; }
164    }
165    public BoolValue OffspringSelectionBeforeMutation {
166      get { return OffspringSelectionBeforeMutationParameter.Value; }
167      set { OffspringSelectionBeforeMutationParameter.Value = value; }
168    }
169    public IntValue SelectedParents {
170      get { return SelectedParentsParameter.Value; }
171      set { SelectedParentsParameter.Value = value; }
172    }
173    public MultiAnalyzer Analyzer {
174      get { return AnalyzerParameter.Value; }
175      set { AnalyzerParameter.Value = value; }
176    }
177    private RandomCreator RandomCreator {
178      get { return (RandomCreator)OperatorGraph.InitialOperator; }
179    }
180    private SolutionsCreator SolutionsCreator {
181      get { return (SolutionsCreator)RandomCreator.Successor; }
182    }
183    private OffspringSelectionGeneticAlgorithmMainLoop MainLoop {
184      get { return (OffspringSelectionGeneticAlgorithmMainLoop)SolutionsCreator.Successor; }
185    }
186    private List<ISelector> selectors;
187    private IEnumerable<ISelector> Selectors {
188      get { return selectors; }
189    }
190    private List<IDiscreteDoubleValueModifier> comparisonFactorModifiers;
191    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
192    private ValueAnalyzer selectionPressureAnalyzer;
193    #endregion
194
195    [StorableConstructor]
196    private OffspringSelectionGeneticAlgorithm(bool deserializing) : base(deserializing) { }
197    public OffspringSelectionGeneticAlgorithm()
198      : base() {
199      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
200      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
201      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100)));
202      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
203      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
204      Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05)));
205      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
206      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
207      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
208      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
209      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0)));
210      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end).", new DoubleValue(1)));
211      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("ComparisonFactorModifier", "The operator used to modify the comparison factor.", new ItemSet<IDiscreteDoubleValueModifier>(new IDiscreteDoubleValueModifier[] { new LinearDiscreteDoubleValueModifier() }), new LinearDiscreteDoubleValueModifier()));
212      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
213      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false)));
214      Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "Should be about 2 * PopulationSize, for large problems use a smaller value to decrease memory footprint.", new IntValue(200)));
215      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
216     
217      RandomCreator randomCreator = new RandomCreator();
218      SolutionsCreator solutionsCreator = new SolutionsCreator();
219      OffspringSelectionGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionGeneticAlgorithmMainLoop();
220      OperatorGraph.InitialOperator = randomCreator;
221
222      randomCreator.RandomParameter.ActualName = "Random";
223      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
224      randomCreator.SeedParameter.Value = null;
225      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
226      randomCreator.SetSeedRandomlyParameter.Value = null;
227      randomCreator.Successor = solutionsCreator;
228
229      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
230      solutionsCreator.Successor = mainLoop;
231
232      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
233      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
234      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
235      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
236      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
237      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
238      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
239      mainLoop.ResultsParameter.ActualName = "Results";
240
241      Initialize();
242    }
243
244    public override IDeepCloneable Clone(Cloner cloner) {
245      OffspringSelectionGeneticAlgorithm clone = (OffspringSelectionGeneticAlgorithm)base.Clone(cloner);
246      clone.Initialize();
247      return clone;
248    }
249
250    public override void Prepare() {
251      if (Problem != null) base.Prepare();
252    }
253
254    #region Events
255    protected override void OnProblemChanged() {
256      ParameterizeStochasticOperator(Problem.SolutionCreator);
257      ParameterizeStochasticOperator(Problem.Evaluator);
258      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
259      ParameterizeSolutionsCreator();
260      ParameterizMainLoop();
261      ParameterizeSelectors();
262      ParameterizeAnalyzers();
263      UpdateCrossovers();
264      UpdateMutators();
265      UpdateAnalyzers();
266      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
267      base.OnProblemChanged();
268    }
269
270    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
271      ParameterizeStochasticOperator(Problem.SolutionCreator);
272      ParameterizeSolutionsCreator();
273      base.Problem_SolutionCreatorChanged(sender, e);
274    }
275    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
276      ParameterizeStochasticOperator(Problem.Evaluator);
277      ParameterizeSolutionsCreator();
278      ParameterizMainLoop();
279      ParameterizeSelectors();
280      ParameterizeAnalyzers();
281      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
282      base.Problem_EvaluatorChanged(sender, e);
283    }
284    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
285      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
286      UpdateCrossovers();
287      UpdateMutators();
288      UpdateAnalyzers();
289      base.Problem_OperatorsChanged(sender, e);
290    }
291    private void ElitesParameter_ValueChanged(object sender, EventArgs e) {
292      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
293      ParameterizeSelectors();
294    }
295    private void Elites_ValueChanged(object sender, EventArgs e) {
296      ParameterizeSelectors();
297    }
298    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
299      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
300      ParameterizeSelectors();
301    }
302    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
303      ParameterizeSelectors();
304    }
305    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
306      ParameterizMainLoop();
307      ParameterizeSelectors();
308      ParameterizeAnalyzers();
309    }
310    #endregion
311
312    #region Helpers
313    [StorableHook(HookType.AfterDeserialization)]
314    private void Initialize() {
315      InitializeSelectors();
316      InitializeAnalyzers();
317      UpdateSelectors();
318      UpdateAnalyzers();
319      InitializeComparisonFactorModifiers();
320      UpdateComparisonFactorModifiers();
321      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
322      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
323      ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged);
324      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
325      if (Problem != null) {
326        UpdateCrossovers();
327        UpdateMutators();
328        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
329      }
330    }
331    private void ParameterizeSolutionsCreator() {
332      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
333      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
334    }
335    private void ParameterizMainLoop() {
336      MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
337      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
338      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
339    }
340    private void ParameterizeStochasticOperator(IOperator op) {
341      if (op is IStochasticOperator)
342        ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
343    }
344    private void InitializeSelectors() {
345      selectors = new List<ISelector>();
346      selectors.AddRange(ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name));
347      ParameterizeSelectors();
348    }
349    private void InitializeAnalyzers() {
350      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
351      selectionPressureAnalyzer = new ValueAnalyzer();
352      ParameterizeAnalyzers();
353    }
354    private void InitializeComparisonFactorModifiers() {
355      comparisonFactorModifiers = new List<IDiscreteDoubleValueModifier>();
356      comparisonFactorModifiers.AddRange(ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name));
357      ParameterizeComparisonFactorModifiers();
358    }
359    private void ParameterizeSelectors() {
360      foreach (ISelector selector in Selectors) {
361        selector.CopySelected = new BoolValue(true);
362        selector.NumberOfSelectedSubScopesParameter.Value = null;
363        selector.NumberOfSelectedSubScopesParameter.ActualName = SelectedParentsParameter.Name;
364        ParameterizeStochasticOperator(selector);
365      }
366      if (Problem != null) {
367        foreach (ISingleObjectiveSelector selector in Selectors.OfType<ISingleObjectiveSelector>()) {
368          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
369          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
370        }
371      }
372    }
373    private void ParameterizeAnalyzers() {
374      qualityAnalyzer.ResultsParameter.ActualName = "Results";
375      selectionPressureAnalyzer.Name = "SelectionPressure Analyzer";
376      selectionPressureAnalyzer.ResultsParameter.ActualName = "Results";
377      selectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure";
378      selectionPressureAnalyzer.ValueParameter.Depth = 0;
379      selectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History";
380      if (Problem != null) {
381        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
382        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
383        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
384      }
385    }
386    private void ParameterizeComparisonFactorModifiers() {
387      foreach (IDiscreteDoubleValueModifier modifier in comparisonFactorModifiers) {
388        modifier.IndexParameter.ActualName = "Generations";
389        modifier.EndIndexParameter.ActualName = MaximumGenerationsParameter.Name;
390        modifier.EndValueParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;
391        modifier.StartIndexParameter.Value = new IntValue(0);
392        modifier.StartValueParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;
393        modifier.ValueParameter.ActualName = "ComparisonFactor";
394      }
395    }
396    private void UpdateSelectors() {
397      ISelector oldSelector = SelectorParameter.Value;
398      SelectorParameter.ValidValues.Clear();
399      foreach (ISelector selector in Selectors.OrderBy(x => x.Name))
400        SelectorParameter.ValidValues.Add(selector);
401
402      ISelector proportionalSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("ProportionalSelector"));
403      if (proportionalSelector != null) SelectorParameter.Value = proportionalSelector;
404
405      if (oldSelector != null) {
406        ISelector selector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldSelector.GetType());
407        if (selector != null) SelectorParameter.Value = selector;
408      }
409    }
410    private void UpdateComparisonFactorModifiers() {
411      IDiscreteDoubleValueModifier oldModifier = ComparisonFactorModifier;
412
413      ComparisonFactorModifierParameter.ValidValues.Clear();
414      foreach (IDiscreteDoubleValueModifier modifier in comparisonFactorModifiers)
415        ComparisonFactorModifierParameter.ValidValues.Add(modifier);
416
417      if (oldModifier != null) {
418        IDiscreteDoubleValueModifier mod = ComparisonFactorModifierParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldModifier.GetType());
419        if (mod != null) ComparisonFactorModifierParameter.Value = mod;
420      }
421    }
422    private void UpdateCrossovers() {
423      ICrossover oldCrossover = CrossoverParameter.Value;
424      CrossoverParameter.ValidValues.Clear();
425      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
426        CrossoverParameter.ValidValues.Add(crossover);
427      if (oldCrossover != null) {
428        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
429        if (crossover != null) CrossoverParameter.Value = crossover;
430      }
431    }
432    private void UpdateMutators() {
433      IManipulator oldMutator = MutatorParameter.Value;
434      MutatorParameter.ValidValues.Clear();
435      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
436        MutatorParameter.ValidValues.Add(mutator);
437      if (oldMutator != null) {
438        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
439        if (mutator != null) MutatorParameter.Value = mutator;
440      }
441    }
442    private void UpdateAnalyzers() {
443      Analyzer.Operators.Clear();
444      Analyzer.Operators.Add(qualityAnalyzer);
445      Analyzer.Operators.Add(selectionPressureAnalyzer);
446      if (Problem != null) {
447        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) {
448          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
449            param.Depth = 1;
450          Analyzer.Operators.Add(analyzer);
451        }
452      }
453    }
454    #endregion
455  }
456}
Note: See TracBrowser for help on using the repository browser.