Changeset 5351
- Timestamp:
- 01/21/11 22:49:02 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r4722 r5351 187 187 } 188 188 private IslandGeneticAlgorithmMainLoop MainLoop { 189 get { return (IslandGeneticAlgorithmMainLoop) IslandProcessor.Successor; }189 get { return (IslandGeneticAlgorithmMainLoop)((UniformSubScopesProcessor)((VariableCreator)IslandProcessor.Successor).Successor).Successor; } 190 190 } 191 191 [Storable] … … 235 235 UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor(); 236 236 SolutionsCreator solutionsCreator = new SolutionsCreator(); 237 VariableCreator variableCreator = new VariableCreator(); 238 UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor(); 239 SubScopesCounter subScopesCounter = new SubScopesCounter(); 237 240 IslandGeneticAlgorithmMainLoop mainLoop = new IslandGeneticAlgorithmMainLoop(); 238 241 OperatorGraph.InitialOperator = randomCreator; … … 249 252 250 253 ussp1.Operator = solutionsCreator; 251 ussp1.Successor = mainLoop;254 ussp1.Successor = variableCreator; 252 255 253 256 solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; 254 257 solutionsCreator.Successor = null; 258 259 variableCreator.Name = "Initialize EvaluatedSolutions"; 260 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue())); 261 variableCreator.Successor = ussp2; 262 263 ussp2.Operator = subScopesCounter; 264 ussp2.Successor = mainLoop; 265 266 subScopesCounter.Name = "Count EvaluatedSolutions"; 267 subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions"; 268 subScopesCounter.Successor = null; 255 269 256 270 mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name; … … 270 284 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 271 285 mainLoop.IslandAnalyzerParameter.ActualName = IslandAnalyzerParameter.Name; 286 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 272 287 mainLoop.Successor = null; 273 288 -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs
r5208 r5351 100 100 public ValueLookupParameter<IOperator> IslandAnalyzerParameter { 101 101 get { return (ValueLookupParameter<IOperator>)Parameters["IslandAnalyzer"]; } 102 } 103 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 104 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 102 105 } 103 106 #endregion … … 135 138 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands.")); 136 139 Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island.")); 140 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times a solution has been evaluated.")); 137 141 #endregion 138 142 … … 144 148 Placeholder analyzer1 = new Placeholder(); 145 149 ResultsCollector resultsCollector1 = new ResultsCollector(); 146 ResultsCollector resultsCollector2 = new ResultsCollector();147 150 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 148 151 Placeholder selector = new Placeholder(); … … 160 163 RightReducer rightReducer = new RightReducer(); 161 164 MergingReducer mergingReducer = new MergingReducer(); 165 IntCounter generationsCounter = new IntCounter(); 166 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 167 SubScopesCounter subScopesCounter = new SubScopesCounter(); 162 168 Placeholder islandAnalyzer2 = new Placeholder(); 163 IntCounter generationsCounter = new IntCounter();164 169 IntCounter generationsSinceLastMigrationCounter = new IntCounter(); 165 170 Comparator migrationComparator = new Comparator(); … … 167 172 Assigner resetGenerationsSinceLastMigrationAssigner = new Assigner(); 168 173 IntCounter migrationsCounter = new IntCounter(); 169 UniformSubScopesProcessor uniformSubScopesProcessor 4= new UniformSubScopesProcessor();174 UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor(); 170 175 Placeholder emigrantsSelector = new Placeholder(); 171 176 Placeholder migrator = new Placeholder(); 172 UniformSubScopesProcessor uniformSubScopesProcessor 5= new UniformSubScopesProcessor();177 UniformSubScopesProcessor uniformSubScopesProcessor6 = new UniformSubScopesProcessor(); 173 178 Placeholder immigrationReplacer = new Placeholder(); 174 179 Comparator generationsComparator = new Comparator(); 175 180 Placeholder analyzer2 = new Placeholder(); 176 ResultsCollector resultsCollector 3= new ResultsCollector();181 ResultsCollector resultsCollector2 = new ResultsCollector(); 177 182 ConditionalBranch generationsTerminationCondition = new ConditionalBranch(); 178 183 … … 191 196 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 192 197 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 198 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results")); 199 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions")); 193 200 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 194 195 resultsCollector2.Name = "Reference Island Results";196 resultsCollector2.CopyValue = new BoolValue(false);197 resultsCollector2.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));198 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;199 201 200 202 selector.Name = "Selector (placeholder)"; … … 223 225 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name; 224 226 bestSelector.QualityParameter.ActualName = QualityParameter.Name; 227 228 subScopesCounter.Name = "Increment EvaluatedSolutions"; 229 subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 225 230 226 231 islandAnalyzer2.Name = "Island Analyzer (placeholder)"; … … 270 275 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 271 276 272 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 273 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 274 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name; 277 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 278 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 279 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions")); 280 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 275 281 276 282 generationsTerminationCondition.Name = "Terminate?"; … … 286 292 islandAnalyzer1.Successor = null; 287 293 analyzer1.Successor = resultsCollector1; 288 resultsCollector1.Successor = resultsCollector2; 289 resultsCollector2.Successor = uniformSubScopesProcessor1; 294 resultsCollector1.Successor = uniformSubScopesProcessor1; 290 295 uniformSubScopesProcessor1.Operator = selector; 291 296 uniformSubScopesProcessor1.Successor = generationsCounter; … … 304 309 subScopesRemover.Successor = null; 305 310 uniformSubScopesProcessor3.Operator = evaluator; 306 uniformSubScopesProcessor3.Successor = null;311 uniformSubScopesProcessor3.Successor = subScopesCounter; 307 312 evaluator.Successor = null; 313 subScopesCounter.Successor = null; 308 314 subScopesProcessor2.Operators.Add(bestSelector); 309 315 subScopesProcessor2.Operators.Add(new EmptyOperator()); … … 311 317 bestSelector.Successor = rightReducer; 312 318 rightReducer.Successor = null; 313 mergingReducer.Successor = islandAnalyzer2; 319 mergingReducer.Successor = null; 320 generationsCounter.Successor = uniformSubScopesProcessor4; 321 uniformSubScopesProcessor4.Operator = islandAnalyzer2; 322 uniformSubScopesProcessor4.Successor = generationsSinceLastMigrationCounter; 314 323 islandAnalyzer2.Successor = null; 315 generationsCounter.Successor = generationsSinceLastMigrationCounter;316 324 generationsSinceLastMigrationCounter.Successor = migrationComparator; 317 325 migrationComparator.Successor = migrationBranch; … … 320 328 migrationBranch.Successor = generationsComparator; 321 329 resetGenerationsSinceLastMigrationAssigner.Successor = migrationsCounter; 322 migrationsCounter.Successor = uniformSubScopesProcessor 4;323 uniformSubScopesProcessor 4.Operator = emigrantsSelector;324 uniformSubScopesProcessor 4.Successor = migrator;325 migrator.Successor = uniformSubScopesProcessor 5;326 uniformSubScopesProcessor 5.Operator = immigrationReplacer;327 uniformSubScopesProcessor 5.Successor = null;330 migrationsCounter.Successor = uniformSubScopesProcessor5; 331 uniformSubScopesProcessor5.Operator = emigrantsSelector; 332 uniformSubScopesProcessor5.Successor = migrator; 333 migrator.Successor = uniformSubScopesProcessor6; 334 uniformSubScopesProcessor6.Operator = immigrationReplacer; 335 uniformSubScopesProcessor6.Successor = null; 328 336 generationsComparator.Successor = analyzer2; 329 analyzer2.Successor = resultsCollector 3;330 resultsCollector 3.Successor = generationsTerminationCondition;337 analyzer2.Successor = resultsCollector2; 338 resultsCollector2.Successor = generationsTerminationCondition; 331 339 generationsTerminationCondition.TrueBranch = null; 332 340 generationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1; -
trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
r5163 r5351 124 124 <SubType>Code</SubType> 125 125 </Compile> 126 <Compile Include="SubScopesCounter.cs" /> 126 127 <Compile Include="SubScopesCreator.cs" /> 127 128 <Compile Include="SubScopesMixer.cs" />
Note: See TracChangeset
for help on using the changeset viewer.