Changeset 13583 for branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms
- Timestamp:
- 02/02/16 14:10:53 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape
- Files:
-
- 4 added
- 7 deleted
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs
r8172 r13583 20 20 #endregion 21 21 22 using System;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators; 27 26 using HeuristicLab.Optimization; 28 27 using HeuristicLab.Optimization.Operators; 29 28 using HeuristicLab.Parameters; 30 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.PluginInfrastructure;32 30 using HeuristicLab.Random; 31 using System; 32 using System.Linq; 33 33 34 34 namespace HeuristicLab.Analysis.FitnessLandscape { 35 35 [Item("Local Analysis", "A local analysis algorithm.")] 36 [Creatable("Algorithms")]37 36 [StorableClass] 38 public sealed class LocalAnalysis : HeuristicOptimizationEngineAlgorithm, IStorableContent{37 public abstract class LocalAnalysis<T> : HeuristicOptimizationEngineAlgorithm, IStorableContent where T : class, IOperator, new() { 39 38 public string Filename { get; set; } 40 39 … … 50 49 51 50 #region Parameter Properties 52 p rivateValueParameter<IntValue> SeedParameter {53 get { return ( ValueParameter<IntValue>)Parameters["Seed"]; }54 } 55 p rivateValueParameter<BoolValue> SetSeedRandomlyParameter {56 get { return ( ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }51 public IFixedValueParameter<IntValue> SeedParameter { 52 get { return (IFixedValueParameter<IntValue>)Parameters["Seed"]; } 53 } 54 public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter { 55 get { return (IFixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; } 57 56 } 58 57 public IConstrainedValueParameter<IManipulator> MutatorParameter { 59 58 get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 60 59 } 61 public IConstrainedValueParameter<ISelector> SelectorParameter { 62 get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; } 63 } 64 private ValueParameter<IntValue> MaximumIterationsParameter { 65 get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; } 66 } 67 private ValueParameter<IntValue> SampleSizeParameter { 68 get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; } 69 } 70 private ValueParameter<MultiAnalyzer> AnalyzerParameter { 71 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 60 public IFixedValueParameter<IntValue> MaximumIterationsParameter { 61 get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; } 62 } 63 public IValueParameter<MultiAnalyzer> AnalyzerParameter { 64 get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 65 } 66 public IFixedValueParameter<T> SelectorParameter { 67 get { return (IFixedValueParameter<T>)Parameters["Selector"]; } 72 68 } 73 69 #endregion 74 70 75 71 #region Properties 76 pr ivateRandomCreator RandomCreator {72 protected RandomCreator RandomCreator { 77 73 get { return (RandomCreator)OperatorGraph.InitialOperator; } 78 74 } 79 private SolutionsCreator SolutionsCreator { 80 get { return (SolutionsCreator)RandomCreator.Successor; } 81 } 82 private LocalAnalysisMainLoop MainLoop { 75 protected VariableCreator VariableCreator { 76 get { return (VariableCreator)RandomCreator.Successor; } 77 } 78 protected SolutionsCreator SolutionsCreator { 79 get { return (SolutionsCreator)VariableCreator.Successor; } 80 } 81 protected LocalAnalysisMainLoop MainLoop { 83 82 get { return (LocalAnalysisMainLoop)SolutionsCreator.Successor; } 84 83 } 85 [Storable] 86 private BestAverageWorstQualityAnalyzer qualityAnalyzer; 84 87 85 [Storable] 88 86 private QualityTrailMultiAnalyzer qualityTrailAnalyzer; … … 90 88 91 89 [StorableConstructor] 92 pr ivateLocalAnalysis(bool deserializing) : base(deserializing) { }93 pr ivate LocalAnalysis(LocalAnalysisoriginal, Cloner cloner)90 protected LocalAnalysis(bool deserializing) : base(deserializing) { } 91 protected LocalAnalysis(LocalAnalysis<T> original, Cloner cloner) 94 92 : base(original, cloner) { 95 qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(original.qualityAnalyzer); 96 qualityTrailAnalyzer = (QualityTrailMultiAnalyzer)cloner.Clone(original.qualityTrailAnalyzer); 97 Initialize(); 98 } 99 public LocalAnalysis() 93 qualityTrailAnalyzer = cloner.Clone(original.qualityTrailAnalyzer); 94 RegisterEventHandlers(); 95 } 96 protected LocalAnalysis(T selector) 100 97 : base() { 101 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));102 Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));98 Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 99 Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 103 100 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "Mutation operator.")); 104 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "Selection operator.")); 105 Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000))); 106 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(1))); 101 Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000))); 107 102 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer())); 103 Parameters.Add(new FixedValueParameter<T>("Selector", "Selection operator.", selector)); 108 104 109 105 RandomCreator randomCreator = new RandomCreator(); 106 VariableCreator variableCreator = new VariableCreator(); 110 107 SolutionsCreator solutionsCreator = new SolutionsCreator(); 111 108 LocalAnalysisMainLoop laMainLoop = new LocalAnalysisMainLoop(); … … 117 114 randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name; 118 115 randomCreator.SetSeedRandomlyParameter.Value = null; 119 randomCreator.Successor = solutionsCreator; 116 randomCreator.Successor = variableCreator; 117 118 variableCreator.Successor = solutionsCreator; 120 119 121 120 solutionsCreator.NumberOfSolutions = new IntValue(1); … … 129 128 laMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 130 129 131 qualityAnalyzer = new BestAverageWorstQualityAnalyzer();132 130 qualityTrailAnalyzer = new QualityTrailMultiAnalyzer(); 133 ParameterizeAnalyzers(); 134 UpdateAnalyzers(); 135 136 Initialize(); 137 } 138 139 public override IDeepCloneable Clone(Cloner cloner) { 140 return new LocalAnalysis(this, cloner); 131 qualityTrailAnalyzer.UpdateIntervalParameter.Value = null; 132 qualityTrailAnalyzer.UpdateIntervalParameter.ActualName = "MaximumIterations"; 133 AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer, true); 134 135 RegisterEventHandlers(); 141 136 } 142 137 143 138 public override void Prepare() { 144 if (Problem != null) 145 base.Prepare(); 139 if (Problem != null) base.Prepare(); 146 140 } 147 141 148 142 #region Events 149 143 protected override void OnProblemChanged() { 150 ParameterizeStochasticOperator(Problem.SolutionCreator); 151 ParameterizeStochasticOperator(Problem.Evaluator); 152 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 153 ParameterizeSolutionsCreator(); 154 ParameterizeMainLoop(); 144 base.OnProblemChanged(); 155 145 UpdateMutators(); 156 UpdateSelectors(); 157 UpdateAnalyzers(); 158 ParameterizeSelector(); 159 ParameterizeAnalyzers(); 160 ParameterizeIterationBasedOperators(); 161 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 162 base.OnProblemChanged(); 146 Parameterize(); 147 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 163 148 } 164 149 protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) { 165 ParameterizeStochasticOperator(Problem.SolutionCreator);166 ParameterizeSolutionsCreator();167 150 base.Problem_SolutionCreatorChanged(sender, e); 151 Parameterize(); 168 152 } 169 153 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 170 ParameterizeStochasticOperator(Problem.Evaluator);171 ParameterizeSolutionsCreator();172 ParameterizeMainLoop();173 ParameterizeSelector();174 ParameterizeAnalyzers();175 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);176 154 base.Problem_EvaluatorChanged(sender, e); 155 Parameterize(); 156 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 177 157 } 178 158 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 179 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);180 159 UpdateMutators(); 181 UpdateSelectors(); 182 UpdateAnalyzers(); 183 ParameterizeMainLoop(); 184 ParameterizeSelector(); 185 ParameterizeAnalyzers(); 186 ParameterizeIterationBasedOperators(); 160 Parameterize(); 187 161 base.Problem_OperatorsChanged(sender, e); 188 162 } 189 163 private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 190 ParameterizeMainLoop(); 191 ParameterizeSelector(); 192 } 193 private void MutatorParameter_ValueChanged(object sender, EventArgs e) { 194 ParameterizeMainLoop(); 195 ParameterizeSelector(); 196 ParameterizeAnalyzers(); 164 Parameterize(); 197 165 } 198 166 #endregion 199 167 200 168 #region Helpers 201 [StorableHook(HookType.AfterDeserialization)] 202 private void Initialize() { 169 private void RegisterEventHandlers() { 203 170 if (Problem != null) { 204 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 205 } 206 MutatorParameter.ValueChanged += MutatorParameter_ValueChanged; 207 } 208 private void UpdateSelectors() { 209 SelectorParameter.ValidValues.Clear(); 210 foreach (var s in ApplicationManager.Manager.GetInstances<ISelector>()) 211 SelectorParameter.ValidValues.Add(s); 212 } 171 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 172 } 173 } 174 213 175 private void UpdateMutators() { 176 var selected = MutatorParameter.Value; 214 177 MutatorParameter.ValidValues.Clear(); 215 178 foreach (var m in Problem.Operators.OfType<IManipulator>()) { 216 179 MutatorParameter.ValidValues.Add(m); 217 } 218 } 219 private void UpdateAnalyzers() { 220 AnalyzerParameter.Value.Operators.Clear(); 221 if (Problem != null) { 222 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) { 223 foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>()) 224 param.Depth = 0; 225 AnalyzerParameter.Value.Operators.Add(analyzer); 226 } 227 } 228 AnalyzerParameter.Value.Operators.Add(qualityAnalyzer); 229 AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer); 230 } 231 private void ParameterizeSolutionsCreator() { 232 SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; 233 SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name; 234 } 235 private void ParameterizeMainLoop() { 180 if (selected != null && selected.GetType() == m.GetType()) MutatorParameter.Value = m; 181 } 182 } 183 184 protected virtual void Parameterize() { 185 if (Problem == null) return; 186 236 187 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 237 188 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 238 189 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 239 } 240 private void ParameterizeStochasticOperator(IOperator op) { 241 if (op is IStochasticOperator) 242 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 243 } 244 private void ParameterizeSelector() { 245 if (Problem != null) { 246 foreach (var op in SelectorParameter.ValidValues) { 247 op.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 248 op.CopySelected = new BoolValue(false); 249 ISingleObjectiveSelector sos = op as ISingleObjectiveSelector; 250 if (sos != null) { 251 sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 252 sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 253 } 254 IStochasticOperator so = op as IStochasticOperator; 255 if (so != null) { 256 so.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 257 } 258 } 259 } 260 } 261 private void ParameterizeAnalyzers() { 262 qualityAnalyzer.ResultsParameter.ActualName = "Results"; 263 if (Problem != null) { 264 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 265 qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 266 } 267 } 268 private void ParameterizeIterationBasedOperators() { 269 if (Problem != null) { 270 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 271 op.IterationsParameter.ActualName = "Iterations"; 272 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 190 foreach (var sOp in Problem.Operators.OfType<IStochasticOperator>()) { 191 sOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 192 } 193 foreach (var iOp in Problem.Operators.OfType<IIterationBasedOperator>()) { 194 iOp.IterationsParameter.ActualName = "Iterations"; 195 iOp.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 196 } 197 var sEval = Problem.Evaluator as IStochasticOperator; 198 if (sEval != null) sEval.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 199 var sCrea = Problem.SolutionCreator as IStochasticOperator; 200 if (sCrea != null) sCrea.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 201 var sSel = SelectorParameter.Value as IStochasticOperator; 202 if (sSel != null) sSel.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 203 var sel = SelectorParameter.Value as ISelector; 204 if (sel != null) { 205 sel.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 206 sel.CopySelected = new BoolValue(false); 207 var sos = sel as ISingleObjectiveSelector; 208 if (sos != null) { 209 sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 210 sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 273 211 } 274 212 } -
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysisMainLoop.cs
r7128 r13583 101 101 #region Create operators 102 102 VariableCreator variableCreator = new VariableCreator(); 103 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor();104 Assigner bestQualityInitializer = new Assigner();105 103 Placeholder analyzer1 = new Placeholder(); 106 ResultsCollector resultsCollector1 = new ResultsCollector();104 SubScopesCounter evaluatedSolutionsCounter1 = new SubScopesCounter(); 107 105 LeftSelector leftSelector = new LeftSelector(); 108 106 SubScopesProcessor mainProcessor = new SubScopesProcessor(); … … 110 108 Placeholder mutator = new Placeholder(); 111 109 Placeholder evaluator = new Placeholder(); 112 IntCounter evaluatedMovesCounter = new IntCounter();110 SubScopesCounter evaluatedSolutionsCounter2 = new SubScopesCounter(); 113 111 Placeholder selector = new Placeholder(); 114 SubScopesProcessor moveMakingProcessor = new SubScopesProcessor(); 115 UniformSubScopesProcessor selectedMoveMakingProcessor = new UniformSubScopesProcessor(); 116 QualityComparator qualityComparator = new QualityComparator(); 117 ConditionalBranch improvesQualityBranch = new ConditionalBranch(); 118 Assigner bestQualityUpdater = new Assigner(); 112 RightReducer rightReducer1 = new RightReducer(); 113 RightReducer rightReducer2 = new RightReducer(); 119 114 Placeholder analyzer2 = new Placeholder(); 120 RightReducer rightReducer = new RightReducer();121 RightReducer rightReducer2 = new RightReducer();122 115 IntCounter iterationsCounter = new IntCounter(); 123 116 Comparator iterationsComparator = new Comparator(); … … 126 119 127 120 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); 128 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 129 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0))); 130 131 bestQualityInitializer.Name = "Initialize BestQuality"; 132 bestQualityInitializer.LeftSideParameter.ActualName = "BestQuality"; 133 bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.ActualName; 121 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 134 122 135 123 analyzer1.Name = "Analyzer (placeholder)"; 136 124 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 137 125 138 resultsCollector1.CopyValue = new BoolValue(false); 139 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 140 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 141 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 142 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 126 evaluatedSolutionsCounter1.Name = "EvaluatedSolutions++"; 127 evaluatedSolutionsCounter1.AccumulateParameter.Value = new BoolValue(true); 128 evaluatedSolutionsCounter1.ValueParameter.ActualName = "EvaluatedSolutions"; 143 129 144 130 leftSelector.CopySelected = new BoolValue(true); 145 131 leftSelector.NumberOfSelectedSubScopesParameter.ActualName = SampleSizeParameter.Name; 146 132 147 mutationProcessor.Parallel = new BoolValue(true); 133 mainProcessor.Name = "Main Processsor"; 134 135 mutationProcessor.Parallel = new BoolValue(false); 148 136 149 137 mutator.Name = "(Mutator)"; … … 153 141 evaluator.OperatorParameter.ActualName = "Evaluator"; 154 142 155 evaluated MovesCounter.Name = "EvaluatedMoves++";156 evaluated MovesCounter.ValueParameter.ActualName = "EvaluatedMoves";157 evaluated MovesCounter.Increment = new IntValue(1);143 evaluatedSolutionsCounter2.Name = "EvaluatedSolutions++"; 144 evaluatedSolutionsCounter2.AccumulateParameter.Value = new BoolValue(true); 145 evaluatedSolutionsCounter2.ValueParameter.ActualName = "EvaluatedSolutions"; 158 146 159 selector.Name = " Selector (placeholder)";147 selector.Name = "(Selector)"; 160 148 selector.OperatorParameter.ActualName = SelectorParameter.Name; 161 149 162 qualityComparator.LeftSideParameter.ActualName = QualityParameter.Name; 163 qualityComparator.RightSideParameter.ActualName = "BestQuality"; 164 qualityComparator.ResultParameter.ActualName = "IsBetter"; 165 166 improvesQualityBranch.ConditionParameter.ActualName = "IsBetter"; 167 168 bestQualityUpdater.Name = "Update BestQuality"; 169 bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality"; 170 bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name; 171 172 analyzer2.Name = "Analyzer (placeholder)"; 150 analyzer2.Name = "(Analyzer)"; 173 151 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 174 152 … … 183 161 iterationsComparator.ResultParameter.ActualName = "Terminate"; 184 162 185 resultsCollector2.CopyValue = new BoolValue(false); 186 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 163 resultsCollector2.CopyValue = new BoolValue(true); 164 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 165 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions")); 187 166 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 188 167 … … 193 172 #region Create operator graph 194 173 OperatorGraph.InitialOperator = variableCreator; 195 variableCreator.Successor = subScopesProcessor0; 196 subScopesProcessor0.Operators.Add(bestQualityInitializer); 197 subScopesProcessor0.Successor = resultsCollector1; 198 bestQualityInitializer.Successor = analyzer1; 199 analyzer1.Successor = null; 200 resultsCollector1.Successor = leftSelector; 174 variableCreator.Successor = evaluatedSolutionsCounter1; 175 evaluatedSolutionsCounter1.Successor = analyzer1; 176 analyzer1.Successor = leftSelector; 201 177 leftSelector.Successor = mainProcessor; 202 178 mainProcessor.Operators.Add(new EmptyOperator()); … … 204 180 mainProcessor.Successor = rightReducer2; 205 181 mutationProcessor.Operator = mutator; 206 mutationProcessor.Successor = selector;182 mutationProcessor.Successor = evaluatedSolutionsCounter2; 207 183 mutator.Successor = evaluator; 208 evaluator.Successor = evaluatedMovesCounter; 209 evaluatedMovesCounter.Successor = null; 210 selector.Successor = moveMakingProcessor; 211 moveMakingProcessor.Operators.Add(new EmptyOperator()); 212 moveMakingProcessor.Operators.Add(selectedMoveMakingProcessor); 213 moveMakingProcessor.Successor = rightReducer; 214 selectedMoveMakingProcessor.Operator = qualityComparator; 215 selectedMoveMakingProcessor.Successor = null; 216 qualityComparator.Successor = improvesQualityBranch; 217 improvesQualityBranch.TrueBranch = bestQualityUpdater; 218 improvesQualityBranch.FalseBranch = null; 219 improvesQualityBranch.Successor = analyzer2; 220 bestQualityUpdater.Successor = null; 221 analyzer2.Successor = null; 222 rightReducer.Successor = null; 184 evaluator.Successor = null; 185 evaluatedSolutionsCounter2.Successor = selector; 186 selector.Successor = rightReducer1; 187 rightReducer1.Successor = null; 223 188 rightReducer2.Successor = iterationsCounter; 224 iterationsCounter.Successor = iterationsComparator;225 iterationsComparator.Successor = resultsCollector2;226 resultsCollector2.Successor = iterationsTermination;227 iterationsTermination.TrueBranch = null;189 iterationsCounter.Successor = analyzer2; 190 analyzer2.Successor = iterationsComparator; 191 iterationsComparator.Successor = iterationsTermination; 192 iterationsTermination.TrueBranch = resultsCollector2; 228 193 iterationsTermination.FalseBranch = leftSelector; 229 194 #endregion 230 195 } 231 232 public override IOperation Apply() {233 return base.Apply();234 }235 196 } 236 197 }
Note: See TracChangeset
for help on using the changeset viewer.