Changeset 5208 for trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
- Timestamp:
- 01/04/11 06:17:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r4722 r5208 109 109 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 110 110 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 111 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));111 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization.")); 112 112 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions.")); 113 113 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); … … 124 124 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 125 125 ChildrenCreator childrenCreator = new ChildrenCreator(); 126 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor();127 Placeholder crossover = new Placeholder();128 126 ConditionalBranch osBeforeMutationBranch = new ConditionalBranch(); 127 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 128 Placeholder crossover1 = new Placeholder(); 129 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 129 130 Placeholder evaluator1 = new Placeholder(); 130 131 IntCounter evaluationCounter1 = new IntCounter(); 131 132 WeightedParentsQualityComparator qualityComparer1 = new WeightedParentsQualityComparator(); 133 SubScopesRemover subScopesRemover1 = new SubScopesRemover(); 134 UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor(); 132 135 StochasticBranch mutationBranch1 = new StochasticBranch(); 133 136 Placeholder mutator1 = new Placeholder(); 137 VariableCreator variableCreator1 = new VariableCreator(); 138 VariableCreator variableCreator2 = new VariableCreator(); 139 ConditionalSelector conditionalSelector = new ConditionalSelector(); 140 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 141 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 134 142 Placeholder evaluator2 = new Placeholder(); 135 143 IntCounter evaluationCounter2 = new IntCounter(); 144 MergingReducer mergingReducer1 = new MergingReducer(); 145 UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor(); 146 Placeholder crossover2 = new Placeholder(); 136 147 StochasticBranch mutationBranch2 = new StochasticBranch(); 137 148 Placeholder mutator2 = new Placeholder(); 149 UniformSubScopesProcessor uniformSubScopesProcessor6 = new UniformSubScopesProcessor(); 138 150 Placeholder evaluator3 = new Placeholder(); 139 151 IntCounter evaluationCounter3 = new IntCounter(); 140 152 WeightedParentsQualityComparator qualityComparer2 = new WeightedParentsQualityComparator(); 141 SubScopesRemover subScopesRemover = new SubScopesRemover();153 SubScopesRemover subScopesRemover2 = new SubScopesRemover(); 142 154 OffspringSelector offspringSelector = new OffspringSelector(); 143 SubScopesProcessor subScopesProcessor 2= new SubScopesProcessor();155 SubScopesProcessor subScopesProcessor3 = new SubScopesProcessor(); 144 156 BestSelector bestSelector = new BestSelector(); 145 157 WorstSelector worstSelector = new WorstSelector(); 146 158 RightReducer rightReducer = new RightReducer(); 147 159 LeftReducer leftReducer = new LeftReducer(); 148 MergingReducer mergingReducer = new MergingReducer();160 MergingReducer mergingReducer2 = new MergingReducer(); 149 161 150 162 selector.Name = "Selector (placeholder)"; … … 153 165 childrenCreator.ParentsPerChild = new IntValue(2); 154 166 155 crossover.Name = "Crossover (placeholder)";156 crossover.OperatorParameter.ActualName = CrossoverParameter.Name;157 158 167 osBeforeMutationBranch.Name = "Apply OS before mutation?"; 159 168 osBeforeMutationBranch.ConditionParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name; 169 170 crossover1.Name = "Crossover (placeholder)"; 171 crossover1.OperatorParameter.ActualName = CrossoverParameter.Name; 172 173 uniformSubScopesProcessor2.Parallel.Value = true; 160 174 161 175 evaluator1.Name = "Evaluator (placeholder)"; … … 172 186 qualityComparer1.ResultParameter.ActualName = "SuccessfulOffspring"; 173 187 188 subScopesRemover1.RemoveAllSubScopes = true; 189 174 190 mutationBranch1.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 175 191 mutationBranch1.RandomParameter.ActualName = RandomParameter.Name; … … 177 193 mutator1.Name = "Mutator (placeholder)"; 178 194 mutator1.OperatorParameter.ActualName = MutatorParameter.Name; 195 196 variableCreator1.Name = "MutatedOffspring = true"; 197 variableCreator1.CollectedValues.Add(new ValueParameter<BoolValue>("MutatedOffspring", null, new BoolValue(true), false)); 198 199 variableCreator2.Name = "MutatedOffspring = false"; 200 variableCreator2.CollectedValues.Add(new ValueParameter<BoolValue>("MutatedOffspring", null, new BoolValue(false), false)); 201 202 conditionalSelector.ConditionParameter.ActualName = "MutatedOffspring"; 203 conditionalSelector.ConditionParameter.Depth = 1; 204 conditionalSelector.CopySelected.Value = false; 205 206 uniformSubScopesProcessor4.Parallel.Value = true; 179 207 180 208 evaluator2.Name = "Evaluator (placeholder)"; … … 185 213 evaluationCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 186 214 215 crossover2.Name = "Crossover (placeholder)"; 216 crossover2.OperatorParameter.ActualName = CrossoverParameter.Name; 217 187 218 mutationBranch2.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 188 219 mutationBranch2.RandomParameter.ActualName = RandomParameter.Name; … … 190 221 mutator2.Name = "Mutator (placeholder)"; 191 222 mutator2.OperatorParameter.ActualName = MutatorParameter.Name; 223 224 uniformSubScopesProcessor6.Parallel.Value = true; 192 225 193 226 evaluator3.Name = "Evaluator (placeholder)"; … … 204 237 qualityComparer2.ResultParameter.ActualName = "SuccessfulOffspring"; 205 238 206 subScopesRemover .RemoveAllSubScopes = true;239 subScopesRemover2.RemoveAllSubScopes = true; 207 240 208 241 offspringSelector.CurrentSuccessRatioParameter.ActualName = CurrentSuccessRatioParameter.Name; … … 231 264 subScopesProcessor1.Operators.Add(childrenCreator); 232 265 subScopesProcessor1.Successor = offspringSelector; 233 childrenCreator.Successor = uniformSubScopesProcessor; 234 uniformSubScopesProcessor.Operator = crossover; 235 uniformSubScopesProcessor.Successor = null; 236 crossover.Successor = osBeforeMutationBranch; 237 osBeforeMutationBranch.TrueBranch = evaluator1; 238 osBeforeMutationBranch.FalseBranch = mutationBranch2; 239 osBeforeMutationBranch.Successor = subScopesRemover; 266 childrenCreator.Successor = osBeforeMutationBranch; 267 osBeforeMutationBranch.TrueBranch = uniformSubScopesProcessor1; 268 osBeforeMutationBranch.FalseBranch = uniformSubScopesProcessor5; 269 osBeforeMutationBranch.Successor = null; 270 uniformSubScopesProcessor1.Operator = crossover1; 271 uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2; 272 crossover1.Successor = null; 273 uniformSubScopesProcessor2.Operator = evaluator1; 274 uniformSubScopesProcessor2.Successor = uniformSubScopesProcessor3; 240 275 evaluator1.Successor = evaluationCounter1; 241 276 evaluationCounter1.Successor = qualityComparer1; 242 qualityComparer1.Successor = mutationBranch1; 277 qualityComparer1.Successor = subScopesRemover1; 278 subScopesRemover1.Successor = null; 279 uniformSubScopesProcessor3.Operator = mutationBranch1; 280 uniformSubScopesProcessor3.Successor = conditionalSelector; 243 281 mutationBranch1.FirstBranch = mutator1; 244 mutationBranch1.SecondBranch = null;282 mutationBranch1.SecondBranch = variableCreator2; 245 283 mutationBranch1.Successor = null; 246 mutator1.Successor = evaluator2; 284 mutator1.Successor = variableCreator1; 285 variableCreator1.Successor = null; 286 variableCreator2.Successor = null; 287 conditionalSelector.Successor = subScopesProcessor2; 288 subScopesProcessor2.Operators.Add(new EmptyOperator()); 289 subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4); 290 subScopesProcessor2.Successor = mergingReducer1; 291 uniformSubScopesProcessor4.Operator = evaluator2; 292 uniformSubScopesProcessor4.Successor = null; 247 293 evaluator2.Successor = evaluationCounter2; 248 294 evaluationCounter2.Successor = null; 295 mergingReducer1.Successor = null; 296 uniformSubScopesProcessor5.Operator = crossover2; 297 uniformSubScopesProcessor5.Successor = uniformSubScopesProcessor6; 298 crossover2.Successor = mutationBranch2; 249 299 mutationBranch2.FirstBranch = mutator2; 250 300 mutationBranch2.SecondBranch = null; 251 mutationBranch2.Successor = evaluator3;301 mutationBranch2.Successor = null; 252 302 mutator2.Successor = null; 303 uniformSubScopesProcessor6.Operator = evaluator3; 304 uniformSubScopesProcessor6.Successor = null; 253 305 evaluator3.Successor = evaluationCounter3; 254 306 evaluationCounter3.Successor = qualityComparer2; 255 subScopesRemover.Successor = null; 307 qualityComparer2.Successor = subScopesRemover2; 308 subScopesRemover2.Successor = null; 256 309 offspringSelector.OffspringCreator = selector; 257 offspringSelector.Successor = subScopesProcessor 2;258 subScopesProcessor 2.Operators.Add(bestSelector);259 subScopesProcessor 2.Operators.Add(worstSelector);260 subScopesProcessor 2.Successor = mergingReducer;310 offspringSelector.Successor = subScopesProcessor3; 311 subScopesProcessor3.Operators.Add(bestSelector); 312 subScopesProcessor3.Operators.Add(worstSelector); 313 subScopesProcessor3.Successor = mergingReducer2; 261 314 bestSelector.Successor = rightReducer; 262 315 rightReducer.Successor = null; 263 316 worstSelector.Successor = leftReducer; 264 317 leftReducer.Successor = null; 265 mergingReducer .Successor = null;318 mergingReducer2.Successor = null; 266 319 #endregion 267 320 }
Note: See TracChangeset
for help on using the changeset viewer.