Changeset 5208
- Timestamp:
- 01/04/11 06:17:50 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs
r4722 r5208 120 120 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 121 121 Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions.")); 122 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));122 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.")); 123 123 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 124 124 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); … … 142 142 Placeholder strategyMutator1 = new Placeholder(); 143 143 Placeholder mutator1 = new Placeholder(); 144 Placeholder evaluator1 = new Placeholder();145 144 SubScopesRemover subScopesRemover = new SubScopesRemover(); 146 145 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 147 146 Placeholder strategyMutator2 = new Placeholder(); 148 147 Placeholder mutator2 = new Placeholder(); 149 Placeholder evaluator2 = new Placeholder(); 148 UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor(); 149 Placeholder evaluator = new Placeholder(); 150 150 ConditionalBranch plusOrCommaReplacementBranch = new ConditionalBranch(); 151 151 MergingReducer plusReplacement = new MergingReducer(); … … 195 195 mutator1.OperatorParameter.ActualName = MutatorParameter.Name; 196 196 197 evaluator1.Name = "Evaluator (placeholder)";198 evaluator1.OperatorParameter.ActualName = EvaluatorParameter.Name;199 200 197 subScopesRemover.RemoveAllSubScopes = true; 201 198 … … 206 203 mutator2.OperatorParameter.ActualName = MutatorParameter.Name; 207 204 208 evaluator2.Name = "Evaluator (placeholder)"; 209 evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name; 205 uniformSubScopesProcessor3.Parallel.Value = true; 206 207 evaluator.Name = "Evaluator (placeholder)"; 208 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 210 209 211 210 plusOrCommaReplacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name; … … 245 244 useRecombinationBranch.TrueBranch = childrenCreator; 246 245 useRecombinationBranch.FalseBranch = uniformSubScopesProcessor2; 247 useRecombinationBranch.Successor = null;246 useRecombinationBranch.Successor = uniformSubScopesProcessor3; 248 247 childrenCreator.Successor = uniformSubScopesProcessor1; 249 248 uniformSubScopesProcessor1.Operator = recombinator; … … 252 251 strategyRecombinator.Successor = strategyMutator1; 253 252 strategyMutator1.Successor = mutator1; 254 mutator1.Successor = evaluator1; 255 evaluator1.Successor = subScopesRemover; 253 mutator1.Successor = subScopesRemover; 256 254 subScopesRemover.Successor = null; 257 255 uniformSubScopesProcessor2.Operator = strategyMutator2; 258 256 uniformSubScopesProcessor2.Successor = null; 259 257 strategyMutator2.Successor = mutator2; 260 mutator2.Successor = evaluator2; 258 mutator2.Successor = null; 259 uniformSubScopesProcessor3.Operator = evaluator; 260 uniformSubScopesProcessor3.Successor = null; 261 evaluator.Successor = null; 261 262 plusOrCommaReplacementBranch.TrueBranch = plusReplacement; 262 263 plusOrCommaReplacementBranch.FalseBranch = commaReplacement; -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs
r4722 r5208 104 104 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 105 105 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 106 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));106 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.")); 107 107 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 108 108 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); … … 119 119 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 120 120 ChildrenCreator childrenCreator = new ChildrenCreator(); 121 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor();121 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 122 122 Placeholder crossover = new Placeholder(); 123 123 StochasticBranch stochasticBranch = new StochasticBranch(); 124 124 Placeholder mutator = new Placeholder(); 125 SubScopesRemover subScopesRemover = new SubScopesRemover(); 126 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 125 127 Placeholder evaluator = new Placeholder(); 126 SubScopesRemover subScopesRemover = new SubScopesRemover();127 128 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 128 129 BestSelector bestSelector = new BestSelector(); … … 157 158 mutator.OperatorParameter.ActualName = "Mutator"; 158 159 160 subScopesRemover.RemoveAllSubScopes = true; 161 162 uniformSubScopesProcessor2.Parallel.Value = true; 163 159 164 evaluator.Name = "Evaluator"; 160 165 evaluator.OperatorParameter.ActualName = "Evaluator"; 161 162 subScopesRemover.RemoveAllSubScopes = true;163 166 164 167 bestSelector.CopySelected = new BoolValue(false); … … 193 196 subScopesProcessor1.Operators.Add(childrenCreator); 194 197 subScopesProcessor1.Successor = subScopesProcessor2; 195 childrenCreator.Successor = uniformSubScopesProcessor ;196 uniformSubScopesProcessor .Operator = crossover;197 uniformSubScopesProcessor .Successor = null;198 childrenCreator.Successor = uniformSubScopesProcessor1; 199 uniformSubScopesProcessor1.Operator = crossover; 200 uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2; 198 201 crossover.Successor = stochasticBranch; 199 202 stochasticBranch.FirstBranch = mutator; 200 203 stochasticBranch.SecondBranch = null; 201 stochasticBranch.Successor = evaluator;204 stochasticBranch.Successor = subScopesRemover; 202 205 mutator.Successor = null; 203 evaluator.Successor = subScopesRemover;204 206 subScopesRemover.Successor = null; 207 uniformSubScopesProcessor2.Operator = evaluator; 208 uniformSubScopesProcessor2.Successor = null; 209 evaluator.Successor = null; 205 210 subScopesProcessor2.Operators.Add(bestSelector); 206 211 subScopesProcessor2.Operators.Add(new EmptyOperator()); -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs
r4722 r5208 130 130 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 131 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. "));132 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.")); 133 133 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 134 134 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); … … 153 153 StochasticBranch stochasticBranch = new StochasticBranch(); 154 154 Placeholder mutator = new Placeholder(); 155 SubScopesRemover subScopesRemover = new SubScopesRemover(); 156 UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor(); 155 157 Placeholder evaluator = new Placeholder(); 156 SubScopesRemover subScopesRemover = new SubScopesRemover();157 158 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 158 159 BestSelector bestSelector = new BestSelector(); … … 166 167 Assigner resetGenerationsSinceLastMigrationAssigner = new Assigner(); 167 168 IntCounter migrationsCounter = new IntCounter(); 168 UniformSubScopesProcessor uniformSubScopesProcessor 3= new UniformSubScopesProcessor();169 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 169 170 Placeholder emigrantsSelector = new Placeholder(); 170 171 Placeholder migrator = new Placeholder(); 171 UniformSubScopesProcessor uniformSubScopesProcessor 4= new UniformSubScopesProcessor();172 UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor(); 172 173 Placeholder immigrationReplacer = new Placeholder(); 173 174 Comparator generationsComparator = new Comparator(); … … 211 212 mutator.OperatorParameter.ActualName = MutatorParameter.Name; 212 213 214 subScopesRemover.RemoveAllSubScopes = true; 215 216 uniformSubScopesProcessor3.Parallel.Value = true; 217 213 218 evaluator.Name = "Evaluator (placeholder)"; 214 219 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 215 216 subScopesRemover.RemoveAllSubScopes = true;217 220 218 221 bestSelector.CopySelected = new BoolValue(false); … … 293 296 childrenCreator.Successor = uniformSubScopesProcessor2; 294 297 uniformSubScopesProcessor2.Operator = crossover; 295 uniformSubScopesProcessor2.Successor = null;298 uniformSubScopesProcessor2.Successor = uniformSubScopesProcessor3; 296 299 crossover.Successor = stochasticBranch; 297 300 stochasticBranch.FirstBranch = mutator; 298 301 stochasticBranch.SecondBranch = null; 299 stochasticBranch.Successor = evaluator;302 stochasticBranch.Successor = subScopesRemover; 300 303 mutator.Successor = null; 301 evaluator.Successor = subScopesRemover;302 304 subScopesRemover.Successor = null; 305 uniformSubScopesProcessor3.Operator = evaluator; 306 uniformSubScopesProcessor3.Successor = null; 307 evaluator.Successor = null; 303 308 subScopesProcessor2.Operators.Add(bestSelector); 304 309 subScopesProcessor2.Operators.Add(new EmptyOperator()); … … 315 320 migrationBranch.Successor = generationsComparator; 316 321 resetGenerationsSinceLastMigrationAssigner.Successor = migrationsCounter; 317 migrationsCounter.Successor = uniformSubScopesProcessor 3;318 uniformSubScopesProcessor 3.Operator = emigrantsSelector;319 uniformSubScopesProcessor 3.Successor = migrator;320 migrator.Successor = uniformSubScopesProcessor 4;321 uniformSubScopesProcessor 4.Operator = immigrationReplacer;322 uniformSubScopesProcessor 4.Successor = null;322 migrationsCounter.Successor = uniformSubScopesProcessor4; 323 uniformSubScopesProcessor4.Operator = emigrantsSelector; 324 uniformSubScopesProcessor4.Successor = migrator; 325 migrator.Successor = uniformSubScopesProcessor5; 326 uniformSubScopesProcessor5.Operator = immigrationReplacer; 327 uniformSubScopesProcessor5.Successor = null; 323 328 generationsComparator.Successor = analyzer2; 324 329 analyzer2.Successor = resultsCollector3; -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
r5143 r5208 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 using HeuristicLab.Selection; 29 using HeuristicLab.Common;30 30 31 31 namespace HeuristicLab.Algorithms.NSGA2 { … … 97 97 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 98 98 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 99 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));99 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.")); 100 100 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 101 101 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); … … 110 110 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 111 111 ChildrenCreator childrenCreator = new ChildrenCreator(); 112 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor();112 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 113 113 StochasticBranch crossoverStochasticBranch = new StochasticBranch(); 114 114 Placeholder crossover = new Placeholder(); … … 116 116 StochasticBranch mutationStochasticBranch = new StochasticBranch(); 117 117 Placeholder mutator = new Placeholder(); 118 SubScopesRemover subScopesRemover = new SubScopesRemover(); 119 UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor(); 118 120 Placeholder evaluator = new Placeholder(); 119 SubScopesRemover subScopesRemover = new SubScopesRemover();120 121 MergingReducer mergingReducer = new MergingReducer(); 121 122 RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter(); … … 156 157 mutator.OperatorParameter.ActualName = MutatorParameter.Name; 157 158 159 subScopesRemover.RemoveAllSubScopes = true; 160 161 uniformSubScopesProcessor2.Parallel.Value = true; 162 158 163 evaluator.Name = "Evaluator"; 159 164 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 160 161 subScopesRemover.RemoveAllSubScopes = true;162 165 163 166 rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance"; … … 193 196 subScopesProcessor1.Operators.Add(childrenCreator); 194 197 subScopesProcessor1.Successor = mergingReducer; 195 childrenCreator.Successor = uniformSubScopesProcessor ;196 uniformSubScopesProcessor .Operator = crossoverStochasticBranch;197 uniformSubScopesProcessor .Successor = null;198 childrenCreator.Successor = uniformSubScopesProcessor1; 199 uniformSubScopesProcessor1.Operator = crossoverStochasticBranch; 200 uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2; 198 201 crossoverStochasticBranch.FirstBranch = crossover; 199 202 crossoverStochasticBranch.SecondBranch = noCrossover; … … 203 206 mutationStochasticBranch.FirstBranch = mutator; 204 207 mutationStochasticBranch.SecondBranch = null; 205 mutationStochasticBranch.Successor = evaluator;208 mutationStochasticBranch.Successor = subScopesRemover; 206 209 mutator.Successor = null; 207 evaluator.Successor = subScopesRemover;208 210 subScopesRemover.Successor = null; 211 uniformSubScopesProcessor2.Operator = evaluator; 212 uniformSubScopesProcessor2.Successor = null; 213 evaluator.Successor = null; 209 214 mergingReducer.Successor = rankAndCrowdingSorter; 210 215 rankAndCrowdingSorter.Successor = leftSelector; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r4722 r5208 153 153 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 154 154 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 155 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));155 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.")); 156 156 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 157 157 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r4722 r5208 115 115 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 116 116 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 117 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));117 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.")); 118 118 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 119 119 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); -
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 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r4722 r5208 129 129 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 130 130 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 131 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. "));131 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.")); 132 132 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 133 133 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); -
trunk/sources/HeuristicLab.Operators/3.3/IntCounter.cs
r4722 r5208 33 33 [StorableClass] 34 34 public sealed class IntCounter : SingleSuccessorOperator { 35 private object locker = new object(); 36 35 37 public LookupParameter<IntValue> ValueParameter { 36 38 get { return (LookupParameter<IntValue>)Parameters["Value"]; } … … 60 62 61 63 public override IOperation Apply() { 62 if (ValueParameter.ActualValue == null) ValueParameter.ActualValue = new IntValue(); 63 ValueParameter.ActualValue.Value += IncrementParameter.ActualValue.Value; 64 lock (locker) { 65 if (ValueParameter.ActualValue == null) ValueParameter.ActualValue = new IntValue(); 66 ValueParameter.ActualValue.Value += IncrementParameter.ActualValue.Value; 67 } 64 68 return base.Apply(); 65 69 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SolutionsCreator.cs
r4722 r5208 29 29 namespace HeuristicLab.Optimization.Operators { 30 30 /// <summary> 31 /// An operator which creates new solutions. 31 /// An operator which creates new solutions. Evaluation of the new solutions is executed in parallel, if an engine is used which supports parallelization. 32 32 /// </summary> 33 [Item("SolutionsCreator", "An operator which creates new solutions. ")]33 [Item("SolutionsCreator", "An operator which creates new solutions. Evaluation of the new solutions is executed in parallel, if an engine is used which supports parallelization.")] 34 34 [StorableClass] 35 35 public sealed class SolutionsCreator : SingleSuccessorOperator { … … 61 61 Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSolutions", "The number of solutions that should be created.")); 62 62 Parameters.Add(new ValueLookupParameter<IOperator>("SolutionCreator", "The operator which is used to create new solutions.")); 63 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions. "));63 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions. This operator is executed in parallel, if an engine is used which supports parallelization.")); 64 64 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope to which the new solutions are added as sub-scopes.")); 65 65 } … … 78 78 CurrentScope.SubScopes.Add(new Scope((current + i).ToString())); 79 79 80 OperationCollection creation = new OperationCollection(); 81 OperationCollection evaluation = new OperationCollection() { Parallel = true }; 82 for (int i = 0; i < count; i++) { 83 if (creator != null) creation.Add(ExecutionContext.CreateOperation(creator, CurrentScope.SubScopes[current + i])); 84 if (evaluator != null) evaluation.Add(ExecutionContext.CreateOperation(evaluator, CurrentScope.SubScopes[current + i])); 85 } 80 86 OperationCollection next = new OperationCollection(); 81 for (int i = 0; i < count; i++) { 82 if (creator != null) next.Add(ExecutionContext.CreateOperation(creator, CurrentScope.SubScopes[current + i])); 83 if (evaluator != null) next.Add(ExecutionContext.CreateOperation(evaluator, CurrentScope.SubScopes[current + i])); 84 } 87 next.Add(creation); 88 next.Add(evaluation); 85 89 next.Add(base.Apply()); 86 90 return next;
Note: See TracChangeset
for help on using the changeset viewer.