Changeset 4017
- Timestamp:
- 07/08/10 12:28:06 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj
r4012 r4017 70 70 <RequiredTargetFramework>3.5</RequiredTargetFramework> 71 71 </Reference> 72 <Reference Include="System.Xml.Linq">73 <RequiredTargetFramework>3.5</RequiredTargetFramework>74 </Reference>75 <Reference Include="System.Data.DataSetExtensions">76 <RequiredTargetFramework>3.5</RequiredTargetFramework>77 </Reference>78 72 <Reference Include="System.Data" /> 79 73 <Reference Include="System.Xml" /> … … 82 76 <None Include="HeuristicLab.snk" /> 83 77 <None Include="HeuristicLabAlgorithmsNSGA2Plugin.cs.frame" /> 78 <Compile Include="CrowdingDistanceAssignment.cs" /> 84 79 <Compile Include="HeuristicLabAlgorithmsNSGA2Plugin.cs" /> 85 80 <Compile Include="NSGA2.cs" /> … … 89 84 </ItemGroup> 90 85 <ItemGroup> 86 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 87 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 88 <Name>HeuristicLab.Analysis-3.3</Name> 89 </ProjectReference> 91 90 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 92 91 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> … … 109 108 <Name>HeuristicLab.Operators-3.3</Name> 110 109 </ProjectReference> 110 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 111 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 112 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 113 </ProjectReference> 111 114 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 112 115 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> … … 124 127 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 125 128 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 129 </ProjectReference> 130 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj"> 131 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project> 132 <Name>HeuristicLab.Random-3.3</Name> 133 </ProjectReference> 134 <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj"> 135 <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project> 136 <Name>HeuristicLab.Selection-3.3</Name> 126 137 </ProjectReference> 127 138 </ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLabAlgorithmsNSGA2Plugin.cs.frame
r4012 r4017 25 25 [Plugin("HeuristicLab.Algorithms.NSGA2", "3.3.0.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Algorithms.NSGA2-3.3.dll", PluginFileType.Assembly)] 27 [PluginDependency("HeuristicLab.Analysis", "3.3")] 27 28 [PluginDependency("HeuristicLab.Collections", "3.3")] 28 29 [PluginDependency("HeuristicLab.Common", "3.3")] … … 31 32 [PluginDependency("HeuristicLab.Operators", "3.3")] 32 33 [PluginDependency("HeuristicLab.Optimization", "3.3")] 34 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 33 35 [PluginDependency("HeuristicLab.Parameters", "3.3")] 34 36 [PluginDependency("HeuristicLab.Persistence", "3.3")] 37 [PluginDependency("HeuristicLab.Random", "3.3")] 38 [PluginDependency("HeuristicLab.Selection", "3.3")] 35 39 public class HeuristicLabAlgorithmsNSGA2Plugin : PluginBase { 36 40 } -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r4012 r4017 21 21 22 22 using System; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Parameters; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Analysis; 31 using HeuristicLab.Random; 32 using HeuristicLab.Optimization.Operators; 33 using HeuristicLab.PluginInfrastructure; 29 34 30 35 namespace HeuristicLab.Algorithms.NSGA2 { … … 32 37 /// The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197. 33 38 /// </summary> 34 [Item("NSGA 2", "The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.")]39 [Item("NSGA-II", "The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.")] 35 40 [Creatable("Algorithms")] 36 41 [StorableClass] … … 47 52 48 53 #region Parameter Properties 49 private ValueLookupParameter<IntValue> PopulationSizeParameter { 50 get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; } 54 private ValueParameter<IntValue> SeedParameter { 55 get { return (ValueParameter<IntValue>)Parameters["Seed"]; } 56 } 57 private ValueParameter<BoolValue> SetSeedRandomlyParameter { 58 get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; } 59 } 60 private ValueParameter<IntValue> PopulationSizeParameter { 61 get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; } 62 } 63 private ConstrainedValueParameter<ISelector> SelectorParameter { 64 get { return (ConstrainedValueParameter<ISelector>)Parameters["Selector"]; } 65 } 66 private ValueParameter<PercentValue> CrossoverProbabilityParameter { 67 get { return (ValueParameter<PercentValue>)Parameters["CrossoverProbability"]; } 68 } 69 private ConstrainedValueParameter<ICrossover> CrossoverParameter { 70 get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; } 71 } 72 private ValueParameter<PercentValue> MutationProbabilityParameter { 73 get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; } 74 } 75 private OptionalConstrainedValueParameter<IManipulator> MutatorParameter { 76 get { return (OptionalConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 77 } 78 private ValueParameter<MultiAnalyzer> AnalyzerParameter { 79 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 80 } 81 private ValueParameter<IntValue> MaximumGenerationsParameter { 82 get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; } 51 83 } 52 84 #endregion 53 85 54 86 #region Properties 87 public IntValue Seed { 88 get { return SeedParameter.Value; } 89 set { SeedParameter.Value = value; } 90 } 91 public BoolValue SetSeedRandomly { 92 get { return SetSeedRandomlyParameter.Value; } 93 set { SetSeedRandomlyParameter.Value = value; } 94 } 95 public IntValue PopulationSize { 96 get { return PopulationSizeParameter.Value; } 97 set { PopulationSizeParameter.Value = value; } 98 } 99 public ISelector Selector { 100 get { return SelectorParameter.Value; } 101 set { SelectorParameter.Value = value; } 102 } 103 public PercentValue CrossoverProbability { 104 get { return CrossoverProbabilityParameter.Value; } 105 set { CrossoverProbabilityParameter.Value = value; } 106 } 107 public ICrossover Crossover { 108 get { return CrossoverParameter.Value; } 109 set { CrossoverParameter.Value = value; } 110 } 111 public PercentValue MutationProbability { 112 get { return MutationProbabilityParameter.Value; } 113 set { MutationProbabilityParameter.Value = value; } 114 } 115 public IManipulator Mutator { 116 get { return MutatorParameter.Value; } 117 set { MutatorParameter.Value = value; } 118 } 119 public MultiAnalyzer Analyzer { 120 get { return AnalyzerParameter.Value; } 121 set { AnalyzerParameter.Value = value; } 122 } 123 public IntValue MaximumGenerations { 124 get { return MaximumGenerationsParameter.Value; } 125 set { MaximumGenerationsParameter.Value = value; } 126 } 127 private RandomCreator RandomCreator { 128 get { return (RandomCreator)OperatorGraph.InitialOperator; } 129 } 130 private SolutionsCreator SolutionsCreator { 131 get { return (SolutionsCreator)RandomCreator.Successor; } 132 } 133 private NSGA2MainLoop MainLoop { 134 get { return (NSGA2MainLoop)SolutionsCreator.Successor; } 135 } 55 136 #endregion 56 137 … … 58 139 public NSGA2(bool deserializing) : base(deserializing) { } 59 140 public NSGA2() { 60 // TODO: Add your parameters here 61 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The population size of the algorithm.", new IntValue(100))); 141 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 142 Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 143 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100))); 144 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.")); 145 Parameters.Add(new ValueParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on two parents.", new PercentValue(0.05))); 146 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 147 Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05))); 148 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 149 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 150 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000))); 151 152 RandomCreator randomCreator = new RandomCreator(); 153 SolutionsCreator solutionsCreator = new SolutionsCreator(); 154 NSGA2MainLoop mainLoop = new NSGA2MainLoop(); 155 OperatorGraph.InitialOperator = randomCreator; 156 157 randomCreator.RandomParameter.ActualName = "Random"; 158 randomCreator.SeedParameter.ActualName = SeedParameter.Name; 159 randomCreator.SeedParameter.Value = null; 160 randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name; 161 randomCreator.SetSeedRandomlyParameter.Value = null; 162 randomCreator.Successor = solutionsCreator; 163 164 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 165 solutionsCreator.Successor = mainLoop; 166 167 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 168 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 169 mainLoop.CrossoverProbabilityParameter.ActualName = CrossoverProbabilityParameter.Name; 170 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 171 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 172 mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 173 mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 174 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 175 mainLoop.ResultsParameter.ActualName = "Results"; 176 177 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) 178 SelectorParameter.ValidValues.Add(selector); 179 ISelector proportionalSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("ProportionalSelector")); 180 if (proportionalSelector != null) SelectorParameter.Value = proportionalSelector; 181 182 // TODO: parameterize selectors 183 184 AttachEventHandlers(); 62 185 } 63 186 … … 67 190 return clone; 68 191 } 192 193 #region Events 194 protected override void OnProblemChanged() { 195 // parameterize pretty much everything 196 base.OnProblemChanged(); 197 } 198 protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) { 199 // parameterize SolutionCreator 200 base.Problem_SolutionCreatorChanged(sender, e); 201 } 202 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 203 // parameterize StochasticOperators 204 // parameterize SolutionsCreator 205 // parameterize MainLoop 206 // parameterize Selectors 207 // parameterize Analyzers 208 Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged); 209 base.Problem_EvaluatorChanged(sender, e); 210 } 211 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 212 base.Problem_OperatorsChanged(sender, e); 213 } 214 protected override void Problem_Reset(object sender, EventArgs e) { 215 base.Problem_Reset(sender, e); 216 } 217 218 private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) { 219 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); 220 // parameterize Selectors 221 } 222 private void PopulationSize_ValueChanged(object sender, EventArgs e) { 223 // parameterize Selectors 224 } 225 226 private void Evaluator_QualitiesParameter_ActualNameChanged(object sender, EventArgs e) { 227 // parameterize Analyzers 228 // parameterize MainLoop 229 // parameterize Selectors 230 } 231 #endregion 232 233 #region Helpers 234 [StorableHook(HookType.AfterDeserialization)] 235 private void AttachEventHandlers() { 236 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); 237 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); 238 if (Problem != null) { 239 Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged); 240 } 241 } 242 #endregion 69 243 } 70 244 } -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
r4012 r4017 23 23 using HeuristicLab.Operators; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Parameters; 26 using HeuristicLab.Data; 27 using HeuristicLab.Optimization.Operators; 28 using HeuristicLab.Selection; 25 29 26 30 namespace HeuristicLab.Algorithms.NSGA2 { … … 31 35 [StorableClass] 32 36 public class NSGA2MainLoop : AlgorithmOperator { 37 #region Parameter properties 38 public ValueLookupParameter<IRandom> RandomParameter { 39 get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; } 40 } 41 public ValueLookupParameter<BoolValue> MaximizationParameter { 42 get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 43 } 44 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 45 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 46 } 47 public ValueLookupParameter<IOperator> SelectorParameter { 48 get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; } 49 } 50 public ValueLookupParameter<PercentValue> CrossoverProbabilityParameter { 51 get { return (ValueLookupParameter<PercentValue>)Parameters["CrossoverProbability"]; } 52 } 53 public ValueLookupParameter<IOperator> CrossoverParameter { 54 get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; } 55 } 56 public ValueLookupParameter<PercentValue> MutationProbabilityParameter { 57 get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; } 58 } 59 public ValueLookupParameter<IOperator> MutatorParameter { 60 get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; } 61 } 62 public ValueLookupParameter<IOperator> EvaluatorParameter { 63 get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; } 64 } 65 public ValueLookupParameter<IntValue> MaximumGenerationsParameter { 66 get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; } 67 } 68 public ValueLookupParameter<VariableCollection> ResultsParameter { 69 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 70 } 71 public ValueLookupParameter<IOperator> AnalyzerParameter { 72 get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; } 73 } 74 #endregion 75 33 76 [StorableConstructor] 34 77 private NSGA2MainLoop(bool deserializing) : base() { } … … 39 82 40 83 private void Initialize() { 41 #region Create Parameters 84 #region Create parameters 85 Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator.")); 86 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 87 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 88 Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction.")); 89 Parameters.Add(new ValueLookupParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on a solution.")); 90 Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions.")); 91 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 92 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 93 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions.")); 94 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 95 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 96 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 42 97 #endregion 43 98 44 #region Create Operators 99 #region Create operators 100 VariableCreator variableCreator = new VariableCreator(); 101 ResultsCollector resultsCollector1 = new ResultsCollector(); 102 Placeholder analyzer1 = new Placeholder(); 103 Placeholder selector = new Placeholder(); 104 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 105 ChildrenCreator childrenCreator = new ChildrenCreator(); 106 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor(); 107 Placeholder crossover = new Placeholder(); 108 StochasticBranch stochasticBranch = new StochasticBranch(); 109 Placeholder mutator = new Placeholder(); 110 Placeholder evaluator = new Placeholder(); 111 SubScopesRemover subScopesRemover = new SubScopesRemover(); 112 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 113 BestSelector bestSelector = new BestSelector(); 114 RightReducer rightReducer = new RightReducer(); 115 MergingReducer mergingReducer = new MergingReducer(); 116 IntCounter intCounter = new IntCounter(); 117 Comparator comparator = new Comparator(); 118 ResultsCollector resultsCollector2 = new ResultsCollector(); 119 Placeholder analyzer2 = new Placeholder(); 120 ConditionalBranch conditionalBranch = new ConditionalBranch(); 121 122 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); 123 124 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 125 resultsCollector1.ResultsParameter.ActualName = "Results"; 126 127 analyzer1.Name = "Analyzer"; 128 analyzer1.OperatorParameter.ActualName = "Analyzer"; 129 130 selector.Name = "Selector"; 131 selector.OperatorParameter.ActualName = "Selector"; 132 133 childrenCreator.ParentsPerChild = new IntValue(2); 134 135 crossover.Name = "Crossover"; 136 crossover.OperatorParameter.ActualName = "Crossover"; 137 138 stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability"; 139 stochasticBranch.RandomParameter.ActualName = "Random"; 140 141 mutator.Name = "Mutator"; 142 mutator.OperatorParameter.ActualName = "Mutator"; 143 144 evaluator.Name = "Evaluator"; 145 evaluator.OperatorParameter.ActualName = "Evaluator"; 146 147 subScopesRemover.RemoveAllSubScopes = true; 148 149 bestSelector.CopySelected = new BoolValue(false); 150 bestSelector.MaximizationParameter.ActualName = "Maximization"; 151 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "Elites"; 152 bestSelector.QualityParameter.ActualName = "Quality"; 153 154 intCounter.Increment = new IntValue(1); 155 intCounter.ValueParameter.ActualName = "Generations"; 156 157 comparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 158 comparator.LeftSideParameter.ActualName = "Generations"; 159 comparator.ResultParameter.ActualName = "Terminate"; 160 comparator.RightSideParameter.ActualName = "MaximumGenerations"; 161 162 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 163 resultsCollector2.ResultsParameter.ActualName = "Results"; 164 165 analyzer2.Name = "Analyzer"; 166 analyzer2.OperatorParameter.ActualName = "Analyzer"; 167 168 conditionalBranch.ConditionParameter.ActualName = "Terminate"; 45 169 #endregion 46 170 47 #region Create Operator Graph 171 #region Create operator graph 172 OperatorGraph.InitialOperator = variableCreator; 173 variableCreator.Successor = resultsCollector1; 174 resultsCollector1.Successor = analyzer1; 175 analyzer1.Successor = selector; 176 selector.Successor = subScopesProcessor1; 177 subScopesProcessor1.Operators.Add(new EmptyOperator()); 178 subScopesProcessor1.Operators.Add(childrenCreator); 179 subScopesProcessor1.Successor = subScopesProcessor2; 180 childrenCreator.Successor = uniformSubScopesProcessor; 181 uniformSubScopesProcessor.Operator = crossover; 182 uniformSubScopesProcessor.Successor = null; 183 crossover.Successor = stochasticBranch; 184 stochasticBranch.FirstBranch = mutator; 185 stochasticBranch.SecondBranch = null; 186 stochasticBranch.Successor = evaluator; 187 mutator.Successor = null; 188 evaluator.Successor = subScopesRemover; 189 subScopesRemover.Successor = null; 190 subScopesProcessor2.Operators.Add(bestSelector); 191 subScopesProcessor2.Operators.Add(new EmptyOperator()); 192 subScopesProcessor2.Successor = mergingReducer; 193 bestSelector.Successor = rightReducer; 194 rightReducer.Successor = null; 195 mergingReducer.Successor = intCounter; 196 intCounter.Successor = comparator; 197 comparator.Successor = resultsCollector2; 198 resultsCollector2.Successor = analyzer2; 199 analyzer2.Successor = conditionalBranch; 200 conditionalBranch.FalseBranch = selector; 201 conditionalBranch.TrueBranch = null; 202 conditionalBranch.Successor = null; 48 203 #endregion 204 } 205 206 public override IOperation Apply() { 207 if (CrossoverParameter.ActualValue == null) 208 return null; 209 return base.Apply(); 49 210 } 50 211 }
Note: See TracChangeset
for help on using the changeset viewer.