[3130] | 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 |
|
---|
| 22 | using HeuristicLab.Analysis;
|
---|
| 23 | using HeuristicLab.Common;
|
---|
| 24 | using HeuristicLab.Core;
|
---|
| 25 | using HeuristicLab.Data;
|
---|
| 26 | using HeuristicLab.Operators;
|
---|
| 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.EvolutionStrategy {
|
---|
| 33 | /// <summary>
|
---|
| 34 | /// An operator which represents the main loop of an evolution strategy (EvolutionStrategy).
|
---|
| 35 | /// </summary>
|
---|
| 36 | [Item("EvolutionStrategyMainLoop", "An operator which represents the main loop of an evolution strategy (EvolutionStrategy).")]
|
---|
| 37 | [StorableClass]
|
---|
| 38 | public sealed class EvolutionStrategyMainLoop : 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 | }
|
---|
| 46 | public SubScopesLookupParameter<DoubleValue> QualityParameter {
|
---|
| 47 | get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; }
|
---|
| 48 | }
|
---|
| 49 | public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
|
---|
| 50 | get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
|
---|
| 51 | }
|
---|
| 52 | public ValueLookupParameter<IntValue> PopulationSizeParameter {
|
---|
| 53 | get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
|
---|
| 54 | }
|
---|
| 55 | public ValueLookupParameter<IntValue> ParentsPerChildParameter {
|
---|
| 56 | get { return (ValueLookupParameter<IntValue>)Parameters["ParentsPerChild"]; }
|
---|
| 57 | }
|
---|
| 58 | public ValueLookupParameter<IntValue> ChildrenParameter {
|
---|
| 59 | get { return (ValueLookupParameter<IntValue>)Parameters["Children"]; }
|
---|
| 60 | }
|
---|
| 61 | public ValueLookupParameter<BoolValue> PlusSelectionParameter {
|
---|
| 62 | get { return (ValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; }
|
---|
| 63 | }
|
---|
| 64 | public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
|
---|
| 65 | get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
|
---|
| 66 | }
|
---|
| 67 | public ValueLookupParameter<IOperator> MutatorParameter {
|
---|
| 68 | get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
|
---|
| 69 | }
|
---|
| 70 | public ValueLookupParameter<IOperator> RecombinatorParameter {
|
---|
| 71 | get { return (ValueLookupParameter<IOperator>)Parameters["Recombinator"]; }
|
---|
| 72 | }
|
---|
| 73 | public ValueLookupParameter<IOperator> EvaluatorParameter {
|
---|
| 74 | get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
|
---|
| 75 | }
|
---|
| 76 | public ValueLookupParameter<VariableCollection> ResultsParameter {
|
---|
| 77 | get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
|
---|
| 78 | }
|
---|
| 79 | public ValueLookupParameter<IOperator> VisualizerParameter {
|
---|
| 80 | get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; }
|
---|
| 81 | }
|
---|
| 82 | public LookupParameter<IItem> VisualizationParameter {
|
---|
| 83 | get { return (LookupParameter<IItem>)Parameters["Visualization"]; }
|
---|
| 84 | }
|
---|
| 85 | private ScopeParameter CurrentScopeParameter {
|
---|
| 86 | get { return (ScopeParameter)Parameters["CurrentScope"]; }
|
---|
| 87 | }
|
---|
| 88 | private ValueLookupParameter<IOperator> StrategyParameterManipulatorParameter {
|
---|
| 89 | get { return (ValueLookupParameter<IOperator>)Parameters["StrategyParameterManipulator"]; }
|
---|
| 90 | }
|
---|
| 91 | private ValueLookupParameter<IOperator> StrategyParameterCrossoverParameter {
|
---|
| 92 | get { return (ValueLookupParameter<IOperator>)Parameters["StrategyParameterCrossover"]; }
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | public IScope CurrentScope {
|
---|
| 96 | get { return CurrentScopeParameter.ActualValue; }
|
---|
| 97 | }
|
---|
| 98 | #endregion
|
---|
| 99 |
|
---|
| 100 | [StorableConstructor]
|
---|
| 101 | private EvolutionStrategyMainLoop(bool deserializing) : base() { }
|
---|
| 102 | public EvolutionStrategyMainLoop()
|
---|
| 103 | : base() {
|
---|
| 104 | Initialize();
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | private void Initialize() {
|
---|
| 108 | #region Create parameters
|
---|
| 109 | Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
|
---|
| 110 | Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
|
---|
| 111 | Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
|
---|
| 112 | Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
|
---|
| 113 | Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "µ (mu) - the size of the population."));
|
---|
| 114 | Parameters.Add(new ValueLookupParameter<IntValue>("ParentsPerChild", "ρ (rho) - how many parents should be recombined."));
|
---|
| 115 | Parameters.Add(new ValueLookupParameter<IntValue>("Children", "λ (lambda) - the size of the offspring population."));
|
---|
| 116 | Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
|
---|
| 117 | Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population)."));
|
---|
| 118 | Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
|
---|
| 119 | Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions."));
|
---|
| 120 | Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
|
---|
| 121 | Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
|
---|
| 122 | Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
|
---|
| 123 | Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
|
---|
| 124 | Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the EvolutionStrategy should be applied."));
|
---|
| 125 | Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterManipulator", "The operator to mutate the endogeneous strategy parameters."));
|
---|
| 126 | Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterCrossover", "The operator to cross the endogeneous strategy parameters."));
|
---|
| 127 | #endregion
|
---|
| 128 |
|
---|
| 129 | #region Create operators
|
---|
| 130 | VariableCreator variableCreator = new VariableCreator();
|
---|
| 131 | BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
|
---|
| 132 | BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
|
---|
| 133 | BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator();
|
---|
| 134 | DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector();
|
---|
| 135 | QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator();
|
---|
| 136 | Placeholder visualizer1 = new Placeholder();
|
---|
| 137 | ResultsCollector resultsCollector = new ResultsCollector();
|
---|
| 138 | WithoutRepeatingBatchedRandomSelector selector = new WithoutRepeatingBatchedRandomSelector();
|
---|
| 139 | SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
|
---|
| 140 | Comparator useRecombinationComparator = new Comparator();
|
---|
| 141 | ConditionalBranch useRecombinationBranch = new ConditionalBranch();
|
---|
| 142 | ChildrenCreator childrenCreator = new ChildrenCreator();
|
---|
| 143 | UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
|
---|
| 144 | Placeholder recombinator = new Placeholder();
|
---|
| 145 | Placeholder strategyRecombinator = new Placeholder();
|
---|
| 146 | Placeholder strategyMutator1 = new Placeholder();
|
---|
| 147 | Placeholder mutator1 = new Placeholder();
|
---|
| 148 | Placeholder evaluator1 = new Placeholder();
|
---|
| 149 | SubScopesRemover subScopesRemover = new SubScopesRemover();
|
---|
| 150 | UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
|
---|
| 151 | Placeholder strategyMutator2 = new Placeholder();
|
---|
| 152 | Placeholder mutator2 = new Placeholder();
|
---|
| 153 | Placeholder evaluator2 = new Placeholder();
|
---|
| 154 | ConditionalBranch plusOrCommaReplacementBranch = new ConditionalBranch();
|
---|
| 155 | MergingReducer plusReplacement = new MergingReducer();
|
---|
| 156 | RightReducer commaReplacement = new RightReducer();
|
---|
| 157 | BestSelector bestSelector = new BestSelector();
|
---|
| 158 | RightReducer rightReducer = new RightReducer();
|
---|
| 159 | IntCounter intCounter = new IntCounter();
|
---|
| 160 | Comparator comparator = new Comparator();
|
---|
| 161 | BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
|
---|
| 162 | BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer();
|
---|
| 163 | BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator();
|
---|
| 164 | DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector();
|
---|
| 165 | QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator();
|
---|
| 166 | Placeholder visualizer2 = new Placeholder();
|
---|
| 167 | ConditionalBranch conditionalBranch = new ConditionalBranch();
|
---|
| 168 |
|
---|
| 169 | variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
|
---|
| 170 |
|
---|
| 171 | bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality";
|
---|
| 172 | bestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 173 | bestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 174 |
|
---|
| 175 | bestQualityMemorizer2.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
|
---|
| 176 | bestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 177 | bestQualityMemorizer2.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 178 |
|
---|
| 179 | bestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageQuality";
|
---|
| 180 | bestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestQuality";
|
---|
| 181 | bestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 182 | bestAverageWorstQualityCalculator1.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 183 | bestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstQuality";
|
---|
| 184 |
|
---|
| 185 | dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
|
---|
| 186 | dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
|
---|
| 187 | dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
|
---|
| 188 | dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
|
---|
| 189 | dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
|
---|
| 190 | dataTableValuesCollector1.DataTableParameter.ActualName = "Qualities";
|
---|
| 191 |
|
---|
| 192 | qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
|
---|
| 193 | qualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
|
---|
| 194 | qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
|
---|
| 195 | qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
|
---|
| 196 |
|
---|
| 197 | visualizer1.Name = "Visualizer (placeholder)";
|
---|
| 198 | visualizer1.OperatorParameter.ActualName = VisualizerParameter.Name;
|
---|
| 199 |
|
---|
| 200 | resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
|
---|
| 201 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
|
---|
| 202 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
|
---|
| 203 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
|
---|
| 204 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
|
---|
| 205 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
|
---|
| 206 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
|
---|
| 207 | resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
|
---|
| 208 | resultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, VisualizationParameter.Name));
|
---|
| 209 | resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
|
---|
| 210 | resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
|
---|
| 211 |
|
---|
| 212 | selector.Name = "ES Random Selector";
|
---|
| 213 | selector.ParentsPerChildParameter.ActualName = ParentsPerChildParameter.Name;
|
---|
| 214 | selector.ChildrenParameter.ActualName = ChildrenParameter.Name;
|
---|
| 215 |
|
---|
| 216 | useRecombinationComparator.Name = "ParentsPerChild > 1";
|
---|
| 217 | useRecombinationComparator.LeftSideParameter.ActualName = ParentsPerChildParameter.Name;
|
---|
| 218 | useRecombinationComparator.RightSideParameter.Value = new IntValue(1);
|
---|
| 219 | useRecombinationComparator.Comparison = new Comparison(ComparisonType.Greater);
|
---|
| 220 | useRecombinationComparator.ResultParameter.ActualName = "UseRecombination";
|
---|
| 221 |
|
---|
| 222 | useRecombinationBranch.Name = "Use Recombination?";
|
---|
| 223 | useRecombinationBranch.ConditionParameter.ActualName = "UseRecombination";
|
---|
| 224 |
|
---|
| 225 | childrenCreator.ParentsPerChild = null;
|
---|
| 226 | childrenCreator.ParentsPerChildParameter.ActualName = ParentsPerChildParameter.Name;
|
---|
| 227 |
|
---|
| 228 | recombinator.Name = "Recombinator (placeholder)";
|
---|
| 229 | recombinator.OperatorParameter.ActualName = RecombinatorParameter.Name;
|
---|
| 230 |
|
---|
| 231 | strategyRecombinator.Name = "Strategy Parameter Recombinator (placeholder)";
|
---|
| 232 | strategyRecombinator.OperatorParameter.ActualName = StrategyParameterCrossoverParameter.Name;
|
---|
| 233 |
|
---|
| 234 | strategyMutator1.Name = "Strategy Parameter Manipulator (placeholder)";
|
---|
| 235 | strategyMutator1.OperatorParameter.ActualName = StrategyParameterManipulatorParameter.Name;
|
---|
| 236 |
|
---|
| 237 | mutator1.Name = "Mutator (placeholder)";
|
---|
| 238 | mutator1.OperatorParameter.ActualName = MutatorParameter.Name;
|
---|
| 239 |
|
---|
| 240 | evaluator1.Name = "Evaluator (placeholder)";
|
---|
| 241 | evaluator1.OperatorParameter.ActualName = EvaluatorParameter.Name;
|
---|
| 242 |
|
---|
| 243 | subScopesRemover.RemoveAllSubScopes = true;
|
---|
| 244 |
|
---|
| 245 | strategyMutator2.Name = "Strategy Parameter Manipulator (placeholder)";
|
---|
| 246 | strategyMutator2.OperatorParameter.ActualName = StrategyParameterManipulatorParameter.Name;
|
---|
| 247 |
|
---|
| 248 | mutator2.Name = "Mutator (placeholder)";
|
---|
| 249 | mutator2.OperatorParameter.ActualName = MutatorParameter.Name;
|
---|
| 250 |
|
---|
| 251 | evaluator2.Name = "Evaluator (placeholder)";
|
---|
| 252 | evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
|
---|
| 253 |
|
---|
| 254 | plusOrCommaReplacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name;
|
---|
| 255 |
|
---|
| 256 | bestSelector.CopySelected = new BoolValue(false);
|
---|
| 257 | bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 258 | bestSelector.NumberOfSelectedSubScopesParameter.ActualName = PopulationSizeParameter.Name;
|
---|
| 259 | bestSelector.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 260 |
|
---|
| 261 | intCounter.Increment = new IntValue(1);
|
---|
| 262 | intCounter.ValueParameter.ActualName = "Generations";
|
---|
| 263 |
|
---|
| 264 | comparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
|
---|
| 265 | comparator.LeftSideParameter.ActualName = "Generations";
|
---|
| 266 | comparator.ResultParameter.ActualName = "Terminate";
|
---|
| 267 | comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
|
---|
| 268 |
|
---|
| 269 | bestQualityMemorizer3.BestQualityParameter.ActualName = "BestQuality";
|
---|
| 270 | bestQualityMemorizer3.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 271 | bestQualityMemorizer3.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 272 |
|
---|
| 273 | bestQualityMemorizer4.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
|
---|
| 274 | bestQualityMemorizer4.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 275 | bestQualityMemorizer4.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 276 |
|
---|
| 277 | bestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageQuality";
|
---|
| 278 | bestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestQuality";
|
---|
| 279 | bestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name;
|
---|
| 280 | bestAverageWorstQualityCalculator2.QualityParameter.ActualName = QualityParameter.Name;
|
---|
| 281 | bestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstQuality";
|
---|
| 282 |
|
---|
| 283 | dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
|
---|
| 284 | dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
|
---|
| 285 | dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
|
---|
| 286 | dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
|
---|
| 287 | dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
|
---|
| 288 | dataTableValuesCollector2.DataTableParameter.ActualName = "Qualities";
|
---|
| 289 |
|
---|
| 290 | qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
|
---|
| 291 | qualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
|
---|
| 292 | qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
|
---|
| 293 | qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
|
---|
| 294 |
|
---|
| 295 | visualizer2.Name = "Visualizer (placeholder)";
|
---|
| 296 | visualizer2.OperatorParameter.ActualName = VisualizerParameter.Name;
|
---|
| 297 |
|
---|
| 298 | conditionalBranch.ConditionParameter.ActualName = "Terminate";
|
---|
| 299 | #endregion
|
---|
| 300 |
|
---|
| 301 | #region Create operator graph
|
---|
| 302 | OperatorGraph.InitialOperator = variableCreator;
|
---|
| 303 | variableCreator.Successor = bestQualityMemorizer1;
|
---|
| 304 | bestQualityMemorizer1.Successor = bestQualityMemorizer2;
|
---|
| 305 | bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1;
|
---|
| 306 | bestAverageWorstQualityCalculator1.Successor = dataTableValuesCollector1;
|
---|
| 307 | dataTableValuesCollector1.Successor = qualityDifferenceCalculator1;
|
---|
| 308 | qualityDifferenceCalculator1.Successor = visualizer1;
|
---|
| 309 | visualizer1.Successor = resultsCollector;
|
---|
| 310 | resultsCollector.Successor = selector;
|
---|
| 311 | selector.Successor = subScopesProcessor1;
|
---|
| 312 | subScopesProcessor1.Operators.Add(new EmptyOperator());
|
---|
| 313 | subScopesProcessor1.Operators.Add(useRecombinationComparator);
|
---|
| 314 | subScopesProcessor1.Successor = plusOrCommaReplacementBranch;
|
---|
| 315 | useRecombinationComparator.Successor = useRecombinationBranch;
|
---|
| 316 | useRecombinationBranch.TrueBranch = childrenCreator;
|
---|
| 317 | useRecombinationBranch.FalseBranch = uniformSubScopesProcessor2;
|
---|
| 318 | useRecombinationBranch.Successor = null;
|
---|
| 319 | childrenCreator.Successor = uniformSubScopesProcessor1;
|
---|
| 320 | uniformSubScopesProcessor1.Operator = recombinator;
|
---|
| 321 | uniformSubScopesProcessor1.Successor = null;
|
---|
| 322 | recombinator.Successor = strategyRecombinator;
|
---|
| 323 | strategyRecombinator.Successor = strategyMutator1;
|
---|
| 324 | strategyMutator1.Successor = mutator1;
|
---|
| 325 | mutator1.Successor = evaluator1;
|
---|
| 326 | evaluator1.Successor = subScopesRemover;
|
---|
| 327 | subScopesRemover.Successor = null;
|
---|
| 328 | uniformSubScopesProcessor2.Operator = strategyMutator2;
|
---|
| 329 | uniformSubScopesProcessor2.Successor = null;
|
---|
| 330 | strategyMutator2.Successor = mutator2;
|
---|
| 331 | mutator2.Successor = evaluator2;
|
---|
| 332 | plusOrCommaReplacementBranch.TrueBranch = plusReplacement;
|
---|
| 333 | plusOrCommaReplacementBranch.FalseBranch = commaReplacement;
|
---|
| 334 | plusOrCommaReplacementBranch.Successor = bestSelector;
|
---|
| 335 | bestSelector.Successor = rightReducer;
|
---|
| 336 | rightReducer.Successor = intCounter;
|
---|
| 337 | intCounter.Successor = comparator;
|
---|
| 338 | comparator.Successor = bestQualityMemorizer3;
|
---|
| 339 | bestQualityMemorizer3.Successor = bestQualityMemorizer4;
|
---|
| 340 | bestQualityMemorizer4.Successor = bestAverageWorstQualityCalculator2;
|
---|
| 341 | bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector2;
|
---|
| 342 | dataTableValuesCollector2.Successor = qualityDifferenceCalculator2;
|
---|
| 343 | qualityDifferenceCalculator2.Successor = visualizer2;
|
---|
| 344 | visualizer2.Successor = conditionalBranch;
|
---|
| 345 | conditionalBranch.FalseBranch = selector;
|
---|
| 346 | conditionalBranch.TrueBranch = null;
|
---|
| 347 | conditionalBranch.Successor = null;
|
---|
| 348 | #endregion
|
---|
| 349 | }
|
---|
| 350 | }
|
---|
| 351 | }
|
---|