Changeset 5366 for trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm
- Timestamp:
- 01/24/11 17:38:42 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r5356 r5366 135 135 } 136 136 private GeneticAlgorithmMainLoop GeneticAlgorithmMainLoop { 137 get { 138 return (GeneticAlgorithmMainLoop)( 139 (ResultsCollector)( 140 (SubScopesCounter)SolutionsCreator.Successor 141 ).Successor 142 ).Successor; 143 } 137 get { return FindMainLoop(SolutionsCreator.Successor); } 144 138 } 145 139 [Storable] … … 375 369 Analyzer.Operators.Add(qualityAnalyzer); 376 370 } 371 private GeneticAlgorithmMainLoop FindMainLoop(IOperator start) { 372 IOperator mainLoop = start; 373 while (mainLoop != null && !(mainLoop is GeneticAlgorithmMainLoop)) 374 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 375 if (mainLoop == null) return null; 376 else return (GeneticAlgorithmMainLoop)mainLoop; 377 } 377 378 #endregion 378 379 } -
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r5356 r5366 187 187 } 188 188 private IslandGeneticAlgorithmMainLoop MainLoop { 189 get { 190 return (IslandGeneticAlgorithmMainLoop)( 191 (ResultsCollector)( 192 (UniformSubScopesProcessor)( 193 (VariableCreator)IslandProcessor.Successor 194 ).Successor 195 ).Successor 196 ).Successor; 197 } 189 get { return FindMainLoop(IslandProcessor.Successor); } 198 190 } 199 191 [Storable] … … 506 498 Analyzer.Operators.Add(qualityAnalyzer); 507 499 } 500 private IslandGeneticAlgorithmMainLoop FindMainLoop(IOperator start) { 501 IOperator mainLoop = start; 502 while (mainLoop != null && !(mainLoop is IslandGeneticAlgorithmMainLoop)) 503 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 504 if (mainLoop == null) return null; 505 else return (IslandGeneticAlgorithmMainLoop)mainLoop; 506 } 508 507 #endregion 509 508 }
Note: See TracChangeset
for help on using the changeset viewer.