Free cookie consent management tool by TermsFeed Policy Generator

source: branches/gteufl/HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy/3.3/OffspringSelectionEvolutionStrategyMainLoop.cs @ 12968

Last change on this file since 12968 was 12968, checked in by gkronber, 7 years ago

#2478 complete changes by gteufl for offspring selection ES

  • Property svn:mime-type set to application/octet-stream
File size: 48.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2013 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 HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.Operators;
26using HeuristicLab.Optimization.Operators;
27using HeuristicLab.Parameters;
28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
29using HeuristicLab.Selection;
30
31namespace HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy {
32  /// <summary>
33  /// An operator which represents the main loop of an evolution strategy (OffspringSelectionEvolutionStrategy).
34  /// </summary>
35  [Item("OffspringSelectionEvolutionStrategyMainLoop", "An operator which represents the main loop of an evolution strategy with offspring selection (OffspringSelectionEvolutionStrategy).")]
36  [StorableClass]
37  public sealed class OffspringSelectionEvolutionStrategyMainLoop : AlgorithmOperator {
38    #region Parameter properties
39    public ValueLookupParameter<IRandom> RandomParameter {
40      get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; }
41    }
42    public ValueLookupParameter<BoolValue> MaximizationParameter {
43      get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
44    }
45    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
46      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
47    }
48    public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
49      get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
50    }
51    public ValueLookupParameter<IntValue> PopulationSizeParameter {
52      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
53    }
54    public ValueLookupParameter<IntValue> ParentsPerChildParameter {
55      get { return (ValueLookupParameter<IntValue>)Parameters["ParentsPerChild"]; }
56    }
57    public ValueLookupParameter<BoolValue> PlusSelectionParameter {
58      get { return (ValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; }
59    }
60    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
61      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
62    }
63    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
64      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
65    }
66    public ValueLookupParameter<IOperator> MutatorParameter {
67      get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
68    }
69    public ValueLookupParameter<IOperator> RecombinatorParameter {
70      get { return (ValueLookupParameter<IOperator>)Parameters["Recombinator"]; }
71    }
72    public ValueLookupParameter<IOperator> EvaluatorParameter {
73      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
74    }
75    public ValueLookupParameter<VariableCollection> ResultsParameter {
76      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
77    }
78    public ValueLookupParameter<IOperator> AnalyzerParameter {
79      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
80    }
81    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
82      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
83    }
84    private ScopeParameter CurrentScopeParameter {
85      get { return (ScopeParameter)Parameters["CurrentScope"]; }
86    }
87    private ValueLookupParameter<IOperator> StrategyParameterManipulatorParameter {
88      get { return (ValueLookupParameter<IOperator>)Parameters["StrategyParameterManipulator"]; }
89    }
90    private ValueLookupParameter<IOperator> StrategyParameterCrossoverParameter {
91      get { return (ValueLookupParameter<IOperator>)Parameters["StrategyParameterCrossover"]; }
92    }
93
94    public LookupParameter<DoubleValue> CurrentSuccessRatioParameter {
95      get { return (LookupParameter<DoubleValue>)Parameters["CurrentSuccessRatio"]; }
96    }
97    public LookupParameter<DoubleValue> SelectionPressureParameter {
98      get { return (LookupParameter<DoubleValue>)Parameters["SelectionPressure"]; }
99    }
100    public ValueLookupParameter<DoubleValue> SuccessRatioParameter {
101       get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
102    }
103    public ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
104      get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
105    }
106    public ValueLookupParameter<IntValue> MaximumEvaluatedSolutionsParameter {
107      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
108    }
109    public ValueLookupParameter<IntValue> SelectedParentsParameter {
110      get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; }
111    }
112    public LookupParameter<DoubleValue> ComparisonFactorParameter {
113      get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
114    }
115
116    public IScope CurrentScope {
117      get { return CurrentScopeParameter.ActualValue; }
118    }
119    #endregion
120
121    [StorableConstructor]
122    private OffspringSelectionEvolutionStrategyMainLoop(bool deserializing) : base(deserializing) { }
123    private OffspringSelectionEvolutionStrategyMainLoop(OffspringSelectionEvolutionStrategyMainLoop original, Cloner cloner)
124      : base(original, cloner) {
125    }
126    public override IDeepCloneable Clone(Cloner cloner) {
127      return new OffspringSelectionEvolutionStrategyMainLoop(this, cloner);
128    }
129    public OffspringSelectionEvolutionStrategyMainLoop()
130      : base() {
131      Initialize();
132    }
133
134    [StorableHook(HookType.AfterDeserialization)]
135    private void AfterDeserialization() {
136      // BackwardsCompatibility3.3
137      #region Backwards compatible code, remove with 3.4
138      if (!Parameters.ContainsKey("ReevaluateElites")) {
139        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
140      }
141      #endregion
142    }
143
144    private void Initialize() {
145      #region Create parameters
146      Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
147      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
148      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
149      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
150      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "µ (mu) - the size of the population."));
151      Parameters.Add(new ValueLookupParameter<IntValue>("ParentsPerChild", "ρ (rho) - how many parents should be recombined."));
152      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
153      Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population)."));
154      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
155      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
156      Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions."));
157      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
158      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
159      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
160      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
161      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the OffspringSelectionEvolutionStrategy should be applied."));
162      Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterManipulator", "The operator to mutate the endogeneous strategy parameters."));
163      Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterCrossover", "The operator to cross the endogeneous strategy parameters."));
164     
165      Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio."));
166      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved."));
167      Parameters.Add(new LookupParameter<DoubleValue>("SelectionPressure", "The actual selection pressure."));
168      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
169      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions."));
170      Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "How much parents should be selected each time the offspring selection step is performed until the population is filled. This parameter should be about the same or twice the size of PopulationSize for smaller problems, and less for large problems."));
171      Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
172
173      #endregion
174
175      #region Create operators
176      VariableCreator variableCreator = new VariableCreator();
177      ResultsCollector resultsCollector1 = new ResultsCollector();
178      Placeholder analyzer1 = new Placeholder();
179      WithoutRepeatingBatchedRandomSelector selector = new WithoutRepeatingBatchedRandomSelector();
180      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
181      Comparator useRecombinationComparator = new Comparator();
182      ConditionalBranch useRecombinationBranch = new ConditionalBranch();
183      ChildrenCreator childrenCreator = new ChildrenCreator();
184      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
185      Placeholder recombinator = new Placeholder();
186      Placeholder strategyRecombinator = new Placeholder();
187      Placeholder strategyMutator1 = new Placeholder();
188      Placeholder mutator1 = new Placeholder();
189      SubScopesRemover subScopesRemover = new SubScopesRemover();
190      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
191      Placeholder strategyMutator2 = new Placeholder();
192      Placeholder mutator2 = new Placeholder();
193      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
194      Placeholder evaluator = new Placeholder();
195      SubScopesCounter subScopesCounter = new SubScopesCounter();
196      ConditionalBranch plusOrCommaReplacementBranch = new ConditionalBranch();
197      MergingReducer plusReplacement = new MergingReducer();
198      RightReducer commaReplacement = new RightReducer();
199      BestSelector bestSelector = new BestSelector();
200      RightReducer rightReducer = new RightReducer();
201      IntCounter intCounter = new IntCounter();
202      Comparator maxGenerationsComparator = new Comparator();
203      Placeholder analyzer2 = new Placeholder();
204      ConditionalBranch conditionalBranchTerminate = new ConditionalBranch();
205      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
206      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
207      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
208      Placeholder evaluator2 = new Placeholder();
209      SubScopesCounter subScopesCounter2 = new SubScopesCounter();
210      WeightedParentsQualityComparator parentsComparator = new WeightedParentsQualityComparator();
211      SubScopesRemover subScopesRemover_afterCompare = new SubScopesRemover();
212      EvolutionStrategyOffspringSelector offspringSelector = new EvolutionStrategyOffspringSelector();
213      ChildrenCopyCreator childrenCopyCreator = new ChildrenCopyCreator();
214      Comparator maxSelectionPressureComparator = new Comparator();
215      ConditionalBranch conditionalBranchTerminateSelPressure = new ConditionalBranch();
216      Comparator maxEvaluatedSolutionsComparator = new Comparator();
217      ConditionalBranch conditionalBranchTerminateEvalSolutions = new ConditionalBranch();
218
219      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionEvolutionStrategy expects this to be called Generations
220      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
221      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0)));
222
223      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
224      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", "Displays the rising selection pressure during a generation.", "SelectionPressure"));
225      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", "Indicates how many successful children were already found during a generation (relative to the population size).", "CurrentSuccessRatio"));
226      resultsCollector1.CopyValue = new BoolValue(false);
227      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
228
229      analyzer1.Name = "Analyzer (placeholder)";
230      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
231
232      selector.Name = "ES Random Selector";
233      selector.RandomParameter.ActualName = RandomParameter.Name;
234      selector.ParentsPerChildParameter.ActualName = ParentsPerChildParameter.Name;
235      selector.ChildrenParameter.ActualName = SelectedParentsParameter.Name;
236
237      useRecombinationComparator.Name = "ParentsPerChild > 1";
238      useRecombinationComparator.LeftSideParameter.ActualName = ParentsPerChildParameter.Name;
239      useRecombinationComparator.RightSideParameter.Value = new IntValue(1);
240      useRecombinationComparator.Comparison = new Comparison(ComparisonType.Greater);
241      useRecombinationComparator.ResultParameter.ActualName = "UseRecombination";
242
243      useRecombinationBranch.Name = "Use Recombination?";
244      useRecombinationBranch.ConditionParameter.ActualName = "UseRecombination";
245
246      childrenCreator.ParentsPerChild = null;
247      childrenCreator.ParentsPerChildParameter.ActualName = ParentsPerChildParameter.Name;
248
249      recombinator.Name = "Recombinator (placeholder)";
250      recombinator.OperatorParameter.ActualName = RecombinatorParameter.Name;
251
252      strategyRecombinator.Name = "Strategy Parameter Recombinator (placeholder)";
253      strategyRecombinator.OperatorParameter.ActualName = StrategyParameterCrossoverParameter.Name;
254
255      strategyMutator1.Name = "Strategy Parameter Manipulator (placeholder)";
256      strategyMutator1.OperatorParameter.ActualName = StrategyParameterManipulatorParameter.Name;
257
258      mutator1.Name = "Mutator (placeholder)";
259      mutator1.OperatorParameter.ActualName = MutatorParameter.Name;
260
261      subScopesRemover.RemoveAllSubScopes = true;
262
263      strategyMutator2.Name = "Strategy Parameter Manipulator (placeholder)";
264      strategyMutator2.OperatorParameter.ActualName = StrategyParameterManipulatorParameter.Name;
265
266      mutator2.Name = "Mutator (placeholder)";
267      mutator2.OperatorParameter.ActualName = MutatorParameter.Name;
268
269      uniformSubScopesProcessor3.Parallel.Value = true;
270
271      evaluator.Name = "Evaluator (placeholder)";
272      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
273
274      subScopesCounter.Name = "Increment EvaluatedSolutions";
275      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
276
277      plusOrCommaReplacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name;
278
279      bestSelector.CopySelected = new BoolValue(false);
280      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
281      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = PopulationSizeParameter.Name;
282      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
283
284      intCounter.Increment = new IntValue(1);
285      intCounter.ValueParameter.ActualName = "Generations";
286
287      maxGenerationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
288      maxGenerationsComparator.LeftSideParameter.ActualName = "Generations";
289      maxGenerationsComparator.ResultParameter.ActualName = "Terminate";
290      maxGenerationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
291
292      analyzer2.Name = "Analyzer (placeholder)";
293      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
294
295      conditionalBranchTerminate.ConditionParameter.ActualName = "Terminate";
296
297      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
298      reevaluateElitesBranch.Name = "Reevaluate elites ?";
299
300      uniformSubScopesProcessor4.Parallel.Value = true;
301
302      evaluator2.Name = "Evaluator (placeholder)";
303      evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
304
305      subScopesCounter2.Name = "Increment EvaluatedSolutions";
306      subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
307
308      parentsComparator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
309      parentsComparator.LeftSideParameter.ActualName = QualityParameter.Name;
310      parentsComparator.RightSideParameter.ActualName = QualityParameter.Name;
311      parentsComparator.MaximizationParameter.ActualName = MaximizationParameter.Name;
312      parentsComparator.ResultParameter.ActualName = "SuccessfulOffspring";
313
314      subScopesRemover_afterCompare.RemoveAllSubScopes = true;
315
316      offspringSelector.CurrentSuccessRatioParameter.ActualName = CurrentSuccessRatioParameter.Name;
317      offspringSelector.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
318      offspringSelector.SelectionPressureParameter.ActualName = SelectionPressureParameter.Name;
319      offspringSelector.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
320      offspringSelector.OffspringPopulationParameter.ActualName = "OffspringPopulation";
321      offspringSelector.OffspringPopulationWinnersParameter.ActualName = "OffspringPopulationWinners";
322      offspringSelector.SuccessfulOffspringParameter.ActualName = "SuccessfulOffspring";
323      offspringSelector.QualityParameter.ActualName = QualityParameter.Name;
324
325      maxSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
326      maxSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
327      maxSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure";
328      maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name;
329
330      conditionalBranchTerminateSelPressure.ConditionParameter.ActualName = "TerminateSelectionPressure";
331
332      maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
333      maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";
334      maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
335      maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = MaximumEvaluatedSolutionsParameter.Name;
336
337      conditionalBranchTerminateEvalSolutions.ConditionParameter.ActualName = "TerminateEvaluatedSolutions";
338
339      #endregion
340
341      #region Create operator graph
342      OperatorGraph.InitialOperator = variableCreator;
343      variableCreator.Successor = resultsCollector1;
344      resultsCollector1.Successor = analyzer1;
345      analyzer1.Successor = selector;
346      selector.Successor = subScopesProcessor1;
347      subScopesProcessor1.Operators.Add(new EmptyOperator());
348      subScopesProcessor1.Operators.Add(useRecombinationComparator);
349
350      subScopesProcessor1.Successor = offspringSelector;
351      offspringSelector.OffspringCreator = selector;
352      offspringSelector.Successor = plusOrCommaReplacementBranch;
353
354      useRecombinationComparator.Successor = useRecombinationBranch;
355      useRecombinationBranch.TrueBranch = childrenCreator;
356
357      useRecombinationBranch.FalseBranch = childrenCopyCreator;
358      childrenCopyCreator.Successor = uniformSubScopesProcessor2;
359
360      useRecombinationBranch.Successor = uniformSubScopesProcessor3;
361      childrenCreator.Successor = uniformSubScopesProcessor1;
362      uniformSubScopesProcessor1.Operator = recombinator;
363      uniformSubScopesProcessor1.Successor = null;
364      recombinator.Successor = strategyRecombinator;
365      strategyRecombinator.Successor = strategyMutator1;
366      strategyMutator1.Successor = mutator1;
367
368      mutator1.Successor = null;
369
370      uniformSubScopesProcessor2.Operator = strategyMutator2;
371      uniformSubScopesProcessor2.Successor = null;
372      strategyMutator2.Successor = mutator2;
373      mutator2.Successor = null;
374      uniformSubScopesProcessor3.Operator = evaluator;
375      uniformSubScopesProcessor3.Successor = subScopesCounter;
376
377      evaluator.Successor = parentsComparator;
378      parentsComparator.Successor = subScopesRemover_afterCompare;
379      subScopesRemover_afterCompare.Successor = null;
380      subScopesCounter.Successor = null;
381
382      plusOrCommaReplacementBranch.TrueBranch = reevaluateElitesBranch;
383      reevaluateElitesBranch.TrueBranch = subScopesProcessor2;
384      reevaluateElitesBranch.FalseBranch = null;
385      subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4);
386      subScopesProcessor2.Operators.Add(new EmptyOperator());
387      uniformSubScopesProcessor4.Operator = evaluator2;
388      uniformSubScopesProcessor4.Successor = subScopesCounter2;
389      subScopesCounter2.Successor = null;
390      reevaluateElitesBranch.Successor = plusReplacement;
391
392      plusReplacement.Successor = bestSelector;
393      bestSelector.Successor = rightReducer;
394
395      plusOrCommaReplacementBranch.FalseBranch = commaReplacement;
396      plusOrCommaReplacementBranch.Successor = intCounter;
397
398
399      intCounter.Successor = maxGenerationsComparator;
400      maxGenerationsComparator.Successor = maxSelectionPressureComparator;
401      maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator;
402      maxEvaluatedSolutionsComparator.Successor = analyzer2;
403      analyzer2.Successor = conditionalBranchTerminate;
404      conditionalBranchTerminate.FalseBranch = conditionalBranchTerminateSelPressure;
405      conditionalBranchTerminate.TrueBranch = null;
406      conditionalBranchTerminate.Successor = null;
407      conditionalBranchTerminateSelPressure.FalseBranch = conditionalBranchTerminateEvalSolutions;
408      conditionalBranchTerminateSelPressure.TrueBranch = null;
409      conditionalBranchTerminateSelPressure.Successor = null;
410      conditionalBranchTerminateEvalSolutions.FalseBranch = selector;
411      conditionalBranchTerminateEvalSolutions.TrueBranch = null;
412      conditionalBranchTerminateEvalSolutions.Successor = null;
413
414      #endregion
415    }
416
417    public override IOperation Apply() {
418      if (MutatorParameter.ActualValue == null)
419        return null;
420      return base.Apply();
421    }
422  }
423}
Note: See TracBrowser for help on using the repository browser.