[3356] | 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 |
|
---|
[4722] | 22 | using HeuristicLab.Common;
|
---|
[3356] | 23 | using HeuristicLab.Core;
|
---|
| 24 | using HeuristicLab.Data;
|
---|
| 25 | using HeuristicLab.Operators;
|
---|
| 26 | using HeuristicLab.Optimization;
|
---|
| 27 | using HeuristicLab.Optimization.Operators;
|
---|
| 28 | using HeuristicLab.Parameters;
|
---|
| 29 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 30 | using HeuristicLab.Selection;
|
---|
| 31 |
|
---|
| 32 | namespace HeuristicLab.Algorithms.GeneticAlgorithm {
|
---|
| 33 | /// <summary>
|
---|
| 34 | /// An island genetic algorithm main loop operator.
|
---|
| 35 | /// </summary>
|
---|
| 36 | [Item("IslandGeneticAlgorithmMainLoop", "An island genetic algorithm main loop operator.")]
|
---|
| 37 | [StorableClass]
|
---|
| 38 | public sealed class IslandGeneticAlgorithmMainLoop : AlgorithmOperator {
|
---|
| 39 | #region Parameter Properties
|
---|
| 40 | public ValueLookupParameter<IRandom> RandomParameter {
|
---|
| 41 | get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; }
|
---|
| 42 | }
|
---|
| 43 | public ValueLookupParameter<BoolValue> MaximizationParameter {
|
---|
| 44 | get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
|
---|
| 45 | }
|
---|
[3659] | 46 | public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
|
---|
| 47 | get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
|
---|
[3356] | 48 | }
|
---|
| 49 | public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
|
---|
| 50 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
|
---|
| 51 | }
|
---|
| 52 | public ValueLookupParameter<IntValue> NumberOfIslandsParameter {
|
---|
| 53 | get { return (ValueLookupParameter<IntValue>)Parameters["NumberOfIslands"]; }
|
---|
| 54 | }
|
---|
| 55 | public ValueLookupParameter<IntValue> MigrationIntervalParameter {
|
---|
| 56 | get { return (ValueLookupParameter<IntValue>)Parameters["MigrationInterval"]; }
|
---|
| 57 | }
|
---|
| 58 | public ValueLookupParameter<PercentValue> MigrationRateParameter {
|
---|
| 59 | get { return (ValueLookupParameter<PercentValue>)Parameters["MigrationRate"]; }
|
---|
| 60 | }
|
---|
| 61 | public ValueLookupParameter<IOperator> MigratorParameter {
|
---|
| 62 | get { return (ValueLookupParameter<IOperator>)Parameters["Migrator"]; }
|
---|
| 63 | }
|
---|
| 64 | public ValueLookupParameter<IOperator> EmigrantsSelectorParameter {
|
---|
| 65 | get { return (ValueLookupParameter<IOperator>)Parameters["EmigrantsSelector"]; }
|
---|
| 66 | }
|
---|
[3601] | 67 | public ValueLookupParameter<IOperator> ImmigrationReplacerParameter {
|
---|
| 68 | get { return (ValueLookupParameter<IOperator>)Parameters["ImmigrationReplacer"]; }
|
---|
[3356] | 69 | }
|
---|
| 70 | public ValueLookupParameter<IntValue> PopulationSizeParameter {
|
---|
| 71 | get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
|
---|
| 72 | }
|
---|
[3609] | 73 | public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
|
---|
| 74 | get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
|
---|
[3356] | 75 | }
|
---|
| 76 | public ValueLookupParameter<IOperator> SelectorParameter {
|
---|
| 77 | get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
|
---|
| 78 | }
|
---|
| 79 | public ValueLookupParameter<IOperator> CrossoverParameter {
|
---|
| 80 | get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
|
---|
| 81 | }
|
---|
| 82 | public ValueLookupParameter<PercentValue> MutationProbabilityParameter {
|
---|
| 83 | get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
|
---|
| 84 | }
|
---|
| 85 | public ValueLookupParameter<IOperator> MutatorParameter {
|
---|
| 86 | get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
|
---|
| 87 | }
|
---|
| 88 | public ValueLookupParameter<IOperator> EvaluatorParameter {
|
---|
| 89 | get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
|
---|
| 90 | }
|
---|
| 91 | public ValueLookupParameter<IntValue> ElitesParameter {
|
---|
| 92 | get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
|
---|
| 93 | }
|
---|
| 94 | public ValueLookupParameter<ResultCollection> ResultsParameter {
|
---|
| 95 | get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
|
---|
| 96 | }
|
---|
[3616] | 97 | public ValueLookupParameter<IOperator> AnalyzerParameter {
|
---|
| 98 | get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
|
---|
[3356] | 99 | }
|
---|
[3650] | 100 | public ValueLookupParameter<IOperator> IslandAnalyzerParameter {
|
---|
| 101 | get { return (ValueLookupParameter<IOperator>)Parameters["IslandAnalyzer"]; }
|
---|
| 102 | }
|
---|
[3356] | 103 | #endregion
|
---|
| 104 |
|
---|
| 105 | [StorableConstructor]
|
---|
[4722] | 106 | private IslandGeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { }
|
---|
| 107 | private IslandGeneticAlgorithmMainLoop(IslandGeneticAlgorithmMainLoop original, Cloner cloner)
|
---|
| 108 | : base(original, cloner) {
|
---|
| 109 | }
|
---|
| 110 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
| 111 | return new IslandGeneticAlgorithmMainLoop(this, cloner);
|
---|
| 112 | }
|
---|
[3356] | 113 | public IslandGeneticAlgorithmMainLoop()
|
---|
| 114 | : base() {
|
---|
| 115 | #region Create parameters
|
---|
| 116 | Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
|
---|
| 117 | Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
|
---|
[3659] | 118 | Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
|
---|
[3356] | 119 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
|
---|
| 120 | Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfIslands", "The number of islands."));
|
---|
| 121 | Parameters.Add(new ValueLookupParameter<IntValue>("MigrationInterval", "The number of generations that should pass between migration phases."));
|
---|
| 122 | Parameters.Add(new ValueLookupParameter<PercentValue>("MigrationRate", "The proportion of individuals that should migrate between the islands."));
|
---|
| 123 | Parameters.Add(new ValueLookupParameter<IOperator>("Migrator", "The migration strategy."));
|
---|
| 124 | Parameters.Add(new ValueLookupParameter<IOperator>("EmigrantsSelector", "Selects the individuals that will be migrated."));
|
---|
[3601] | 125 | Parameters.Add(new ValueLookupParameter<IOperator>("ImmigrationReplacer", "Replaces some of the original population with the immigrants."));
|
---|
[3356] | 126 | Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions."));
|
---|
[3609] | 127 | Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations that the algorithm should process."));
|
---|
[3356] | 128 | Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
|
---|
| 129 | Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
|
---|
| 130 | Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
|
---|
| 131 | Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
|
---|
| 132 | Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
|
---|
| 133 | Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
|
---|
| 134 | Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
|
---|
[3650] | 135 | Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands."));
|
---|
| 136 | Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
|
---|
[3356] | 137 | #endregion
|
---|
| 138 |
|
---|
| 139 | #region Create operators
|
---|
| 140 | VariableCreator variableCreator = new VariableCreator();
|
---|
[3609] | 141 | UniformSubScopesProcessor uniformSubScopesProcessor0 = new UniformSubScopesProcessor();
|
---|
| 142 | VariableCreator islandVariableCreator = new VariableCreator();
|
---|
[3616] | 143 | Placeholder islandAnalyzer1 = new Placeholder();
|
---|
[3650] | 144 | Placeholder analyzer1 = new Placeholder();
|
---|
| 145 | ResultsCollector resultsCollector1 = new ResultsCollector();
|
---|
| 146 | ResultsCollector resultsCollector2 = new ResultsCollector();
|
---|
[3609] | 147 | UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
|
---|
| 148 | Placeholder selector = new Placeholder();
|
---|
| 149 | SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
|
---|
| 150 | ChildrenCreator childrenCreator = new ChildrenCreator();
|
---|
| 151 | UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
|
---|
| 152 | Placeholder crossover = new Placeholder();
|
---|
| 153 | StochasticBranch stochasticBranch = new StochasticBranch();
|
---|
| 154 | Placeholder mutator = new Placeholder();
|
---|
| 155 | Placeholder evaluator = new Placeholder();
|
---|
| 156 | SubScopesRemover subScopesRemover = new SubScopesRemover();
|
---|
| 157 | SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
|
---|
| 158 | BestSelector bestSelector = new BestSelector();
|
---|
| 159 | RightReducer rightReducer = new RightReducer();
|
---|
| 160 | MergingReducer mergingReducer = new MergingReducer();
|
---|
[3616] | 161 | Placeholder islandAnalyzer2 = new Placeholder();
|
---|
[3611] | 162 | IntCounter generationsCounter = new IntCounter();
|
---|
[3609] | 163 | IntCounter generationsSinceLastMigrationCounter = new IntCounter();
|
---|
| 164 | Comparator migrationComparator = new Comparator();
|
---|
| 165 | ConditionalBranch migrationBranch = new ConditionalBranch();
|
---|
| 166 | Assigner resetGenerationsSinceLastMigrationAssigner = new Assigner();
|
---|
| 167 | IntCounter migrationsCounter = new IntCounter();
|
---|
| 168 | UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
|
---|
[3356] | 169 | Placeholder emigrantsSelector = new Placeholder();
|
---|
| 170 | Placeholder migrator = new Placeholder();
|
---|
[3609] | 171 | UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
|
---|
[3601] | 172 | Placeholder immigrationReplacer = new Placeholder();
|
---|
[3609] | 173 | Comparator generationsComparator = new Comparator();
|
---|
[3650] | 174 | Placeholder analyzer2 = new Placeholder();
|
---|
| 175 | ResultsCollector resultsCollector3 = new ResultsCollector();
|
---|
[3609] | 176 | ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
|
---|
[3356] | 177 |
|
---|
| 178 | variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations", new IntValue(0)));
|
---|
[3609] | 179 | variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0)));
|
---|
[3750] | 180 | variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class IslandGeneticAlgorithm expects this to be called Generations
|
---|
[3356] | 181 |
|
---|
[3650] | 182 | islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
|
---|
[3356] | 183 |
|
---|
[3650] | 184 | islandAnalyzer1.Name = "Island Analyzer (placeholder)";
|
---|
| 185 | islandAnalyzer1.OperatorParameter.ActualName = IslandAnalyzerParameter.Name;
|
---|
[3609] | 186 |
|
---|
[3650] | 187 | analyzer1.Name = "Analyzer (placeholder)";
|
---|
| 188 | analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
|
---|
[3609] | 189 |
|
---|
[3650] | 190 | resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
|
---|
| 191 | resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
|
---|
| 192 | resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
|
---|
[3609] | 193 |
|
---|
[3650] | 194 | resultsCollector2.Name = "Reference Island Results";
|
---|
| 195 | resultsCollector2.CopyValue = new BoolValue(false);
|
---|
[3659] | 196 | resultsCollector2.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));
|
---|
[3650] | 197 | resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
|
---|
[3609] | 198 |
|
---|
| 199 | selector.Name = "Selector (placeholder)";
|
---|
| 200 | selector.OperatorParameter.ActualName = SelectorParameter.Name;
|
---|
[3356] | 201 |
|
---|
[3609] | 202 | childrenCreator.ParentsPerChild = new IntValue(2);
|
---|
| 203 |
|
---|
| 204 | crossover.Name = "Crossover (placeholder)";
|
---|
| 205 | crossover.OperatorParameter.ActualName = CrossoverParameter.Name;
|
---|
| 206 |
|
---|
| 207 | stochasticBranch.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
|
---|
| 208 | stochasticBranch.RandomParameter.ActualName = RandomParameter.Name;
|
---|
| 209 |
|
---|
| 210 | mutator.Name = "Mutator (placeholder)";
|
---|
| 211 | mutator.OperatorParameter.ActualName = MutatorParameter.Name;
|
---|
| 212 |
|
---|
| 213 | evaluator.Name = "Evaluator (placeholder)";
|
---|
| 214 | evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
|
---|
| 215 |
|
---|
| 216 | subScopesRemover.RemoveAllSubScopes = true;
|
---|
| 217 |
|
---|
| 218 | bestSelector.CopySelected = new BoolValue(false);
|
---|
| 219 | bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 220 | bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
|
---|
| 221 | bestSelector.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 222 |
|
---|
[3650] | 223 | islandAnalyzer2.Name = "Island Analyzer (placeholder)";
|
---|
| 224 | islandAnalyzer2.OperatorParameter.ActualName = IslandAnalyzerParameter.Name;
|
---|
[3609] | 225 |
|
---|
[3611] | 226 | generationsCounter.Name = "Generations + 1";
|
---|
| 227 | generationsCounter.Increment = new IntValue(1);
|
---|
| 228 | generationsCounter.ValueParameter.ActualName = "Generations";
|
---|
| 229 |
|
---|
| 230 | generationsSinceLastMigrationCounter.Name = "GenerationsSinceLastMigration + 1";
|
---|
[3609] | 231 | generationsSinceLastMigrationCounter.ValueParameter.ActualName = "GenerationsSinceLastMigration";
|
---|
| 232 | generationsSinceLastMigrationCounter.Increment = new IntValue(1);
|
---|
| 233 |
|
---|
[3611] | 234 | migrationComparator.Name = "GenerationsSinceLastMigration = MigrationInterval ?";
|
---|
[3609] | 235 | migrationComparator.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
|
---|
| 236 | migrationComparator.Comparison = new Comparison(ComparisonType.Equal);
|
---|
| 237 | migrationComparator.RightSideParameter.ActualName = MigrationIntervalParameter.Name;
|
---|
| 238 | migrationComparator.ResultParameter.ActualName = "Migrate";
|
---|
| 239 |
|
---|
[3611] | 240 | migrationBranch.Name = "Migrate?";
|
---|
[3609] | 241 | migrationBranch.ConditionParameter.ActualName = "Migrate";
|
---|
| 242 |
|
---|
[3611] | 243 | resetGenerationsSinceLastMigrationAssigner.Name = "Reset GenerationsSinceLastMigration";
|
---|
[3609] | 244 | resetGenerationsSinceLastMigrationAssigner.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
|
---|
| 245 | resetGenerationsSinceLastMigrationAssigner.RightSideParameter.Value = new IntValue(0);
|
---|
| 246 |
|
---|
| 247 | migrationsCounter.Name = "Migrations + 1";
|
---|
| 248 | migrationsCounter.IncrementParameter.Value = new IntValue(1);
|
---|
| 249 | migrationsCounter.ValueParameter.ActualName = "Migrations";
|
---|
| 250 |
|
---|
[3356] | 251 | emigrantsSelector.Name = "Emigrants Selector (placeholder)";
|
---|
| 252 | emigrantsSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name;
|
---|
| 253 |
|
---|
| 254 | migrator.Name = "Migrator (placeholder)";
|
---|
| 255 | migrator.OperatorParameter.ActualName = MigratorParameter.Name;
|
---|
| 256 |
|
---|
[3601] | 257 | immigrationReplacer.Name = "Immigration Replacer (placeholder)";
|
---|
| 258 | immigrationReplacer.OperatorParameter.ActualName = ImmigrationReplacerParameter.Name;
|
---|
[3356] | 259 |
|
---|
[3611] | 260 | generationsComparator.Name = "Generations >= MaximumGenerations ?";
|
---|
[3609] | 261 | generationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
|
---|
| 262 | generationsComparator.LeftSideParameter.ActualName = "Generations";
|
---|
| 263 | generationsComparator.ResultParameter.ActualName = "TerminateGenerations";
|
---|
| 264 | generationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
|
---|
[3356] | 265 |
|
---|
[3650] | 266 | analyzer2.Name = "Analyzer (placeholder)";
|
---|
| 267 | analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
|
---|
[3356] | 268 |
|
---|
[3650] | 269 | resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
|
---|
| 270 | resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
|
---|
| 271 | resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
|
---|
[3356] | 272 |
|
---|
[3611] | 273 | generationsTerminationCondition.Name = "Terminate?";
|
---|
[3609] | 274 | generationsTerminationCondition.ConditionParameter.ActualName = "TerminateGenerations";
|
---|
[3356] | 275 | #endregion
|
---|
| 276 |
|
---|
| 277 | #region Create operator graph
|
---|
| 278 | OperatorGraph.InitialOperator = variableCreator;
|
---|
[3609] | 279 | variableCreator.Successor = uniformSubScopesProcessor0;
|
---|
| 280 | uniformSubScopesProcessor0.Operator = islandVariableCreator;
|
---|
[3650] | 281 | uniformSubScopesProcessor0.Successor = analyzer1;
|
---|
| 282 | islandVariableCreator.Successor = islandAnalyzer1;
|
---|
| 283 | islandAnalyzer1.Successor = null;
|
---|
| 284 | analyzer1.Successor = resultsCollector1;
|
---|
| 285 | resultsCollector1.Successor = resultsCollector2;
|
---|
| 286 | resultsCollector2.Successor = uniformSubScopesProcessor1;
|
---|
[3609] | 287 | uniformSubScopesProcessor1.Operator = selector;
|
---|
[3611] | 288 | uniformSubScopesProcessor1.Successor = generationsCounter;
|
---|
[3609] | 289 | selector.Successor = subScopesProcessor1;
|
---|
| 290 | subScopesProcessor1.Operators.Add(new EmptyOperator());
|
---|
| 291 | subScopesProcessor1.Operators.Add(childrenCreator);
|
---|
| 292 | subScopesProcessor1.Successor = subScopesProcessor2;
|
---|
| 293 | childrenCreator.Successor = uniformSubScopesProcessor2;
|
---|
| 294 | uniformSubScopesProcessor2.Operator = crossover;
|
---|
| 295 | uniformSubScopesProcessor2.Successor = null;
|
---|
| 296 | crossover.Successor = stochasticBranch;
|
---|
| 297 | stochasticBranch.FirstBranch = mutator;
|
---|
| 298 | stochasticBranch.SecondBranch = null;
|
---|
| 299 | stochasticBranch.Successor = evaluator;
|
---|
| 300 | mutator.Successor = null;
|
---|
| 301 | evaluator.Successor = subScopesRemover;
|
---|
| 302 | subScopesRemover.Successor = null;
|
---|
| 303 | subScopesProcessor2.Operators.Add(bestSelector);
|
---|
| 304 | subScopesProcessor2.Operators.Add(new EmptyOperator());
|
---|
| 305 | subScopesProcessor2.Successor = mergingReducer;
|
---|
| 306 | bestSelector.Successor = rightReducer;
|
---|
| 307 | rightReducer.Successor = null;
|
---|
[3650] | 308 | mergingReducer.Successor = islandAnalyzer2;
|
---|
[3616] | 309 | islandAnalyzer2.Successor = null;
|
---|
[3611] | 310 | generationsCounter.Successor = generationsSinceLastMigrationCounter;
|
---|
[3609] | 311 | generationsSinceLastMigrationCounter.Successor = migrationComparator;
|
---|
| 312 | migrationComparator.Successor = migrationBranch;
|
---|
| 313 | migrationBranch.TrueBranch = resetGenerationsSinceLastMigrationAssigner;
|
---|
| 314 | migrationBranch.FalseBranch = null;
|
---|
[3611] | 315 | migrationBranch.Successor = generationsComparator;
|
---|
[3609] | 316 | resetGenerationsSinceLastMigrationAssigner.Successor = migrationsCounter;
|
---|
| 317 | migrationsCounter.Successor = uniformSubScopesProcessor3;
|
---|
| 318 | uniformSubScopesProcessor3.Operator = emigrantsSelector;
|
---|
| 319 | uniformSubScopesProcessor3.Successor = migrator;
|
---|
| 320 | migrator.Successor = uniformSubScopesProcessor4;
|
---|
| 321 | uniformSubScopesProcessor4.Operator = immigrationReplacer;
|
---|
| 322 | uniformSubScopesProcessor4.Successor = null;
|
---|
[3650] | 323 | generationsComparator.Successor = analyzer2;
|
---|
| 324 | analyzer2.Successor = resultsCollector3;
|
---|
| 325 | resultsCollector3.Successor = generationsTerminationCondition;
|
---|
[3609] | 326 | generationsTerminationCondition.TrueBranch = null;
|
---|
| 327 | generationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1;
|
---|
| 328 | generationsTerminationCondition.Successor = null;
|
---|
[3356] | 329 | #endregion
|
---|
| 330 | }
|
---|
[3715] | 331 |
|
---|
| 332 | public override IOperation Apply() {
|
---|
| 333 | if (CrossoverParameter.ActualValue == null)
|
---|
| 334 | return null;
|
---|
| 335 | return base.Apply();
|
---|
| 336 | }
|
---|
[3356] | 337 | }
|
---|
| 338 | }
|
---|