Changeset 5366
- Timestamp:
- 01/24/11 17:38:42 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 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 } -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r5356 r5366 118 118 } 119 119 private LocalSearchMainLoop MainLoop { 120 get { 121 return (LocalSearchMainLoop)( 122 (ResultsCollector)( 123 (VariableCreator)SolutionsCreator.Successor 124 ).Successor 125 ).Successor; 126 } 120 get { return FindMainLoop(SolutionsCreator.Successor); } 127 121 } 128 122 [Storable] … … 396 390 } 397 391 } 392 private LocalSearchMainLoop FindMainLoop(IOperator start) { 393 IOperator mainLoop = start; 394 while (mainLoop != null && !(mainLoop is LocalSearchMainLoop)) 395 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 396 if (mainLoop == null) return null; 397 else return (LocalSearchMainLoop)mainLoop; 398 } 398 399 #endregion 399 400 } -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r5356 r5366 42 42 [StorableClass] 43 43 public class NSGA2 : EngineAlgorithm, IStorableContent { 44 public string Filename { get; set; } 45 44 46 #region Problem Properties 45 47 public override Type ProblemType { … … 143 145 } 144 146 private NSGA2MainLoop MainLoop { 145 get { 146 return (NSGA2MainLoop)( 147 (ResultsCollector)RankAndCrowdingSorter.Successor 148 ).Successor; 149 } 147 get { return FindMainLoop(RankAndCrowdingSorter.Successor); } 150 148 } 151 149 #endregion … … 392 390 Analyzer.Operators.Add(paretoFrontAnalyzer); 393 391 } 392 private NSGA2MainLoop FindMainLoop(IOperator start) { 393 IOperator mainLoop = start; 394 while (mainLoop != null && !(mainLoop is NSGA2MainLoop)) 395 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 396 if (mainLoop == null) return null; 397 else return (NSGA2MainLoop)mainLoop; 398 } 394 399 #endregion 395 396 public string Filename {397 get;398 set;399 }400 400 } 401 401 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r5356 r5366 239 239 } 240 240 private IslandOffspringSelectionGeneticAlgorithmMainLoop MainLoop { 241 get { 242 return (IslandOffspringSelectionGeneticAlgorithmMainLoop)( 243 (ResultsCollector)( 244 (UniformSubScopesProcessor)( 245 (VariableCreator)IslandProcessor.Successor 246 ).Successor 247 ).Successor 248 ).Successor; 249 } 241 get { return FindMainLoop(IslandProcessor.Successor); } 250 242 } 251 243 [Storable] … … 625 617 Analyzer.Operators.Add(selectionPressureAnalyzer); 626 618 } 619 private IslandOffspringSelectionGeneticAlgorithmMainLoop FindMainLoop(IOperator start) { 620 IOperator mainLoop = start; 621 while (mainLoop != null && !(mainLoop is IslandOffspringSelectionGeneticAlgorithmMainLoop)) 622 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 623 if (mainLoop == null) return null; 624 else return (IslandOffspringSelectionGeneticAlgorithmMainLoop)mainLoop; 625 } 627 626 #endregion 628 627 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r5356 r5366 191 191 } 192 192 private OffspringSelectionGeneticAlgorithmMainLoop MainLoop { 193 get { 194 return (OffspringSelectionGeneticAlgorithmMainLoop)( 195 (ResultsCollector)( 196 (SubScopesCounter)SolutionsCreator.Successor 197 ).Successor 198 ).Successor; 199 } 193 get { return FindMainLoop(SolutionsCreator.Successor); } 200 194 } 201 195 [Storable] … … 469 463 Analyzer.Operators.Add(selectionPressureAnalyzer); 470 464 } 465 private OffspringSelectionGeneticAlgorithmMainLoop FindMainLoop(IOperator start) { 466 IOperator mainLoop = start; 467 while (mainLoop != null && !(mainLoop is OffspringSelectionGeneticAlgorithmMainLoop)) 468 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 469 if (mainLoop == null) return null; 470 else return (OffspringSelectionGeneticAlgorithmMainLoop)mainLoop; 471 } 471 472 #endregion 472 473 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r5356 r5366 215 215 } 216 216 private SASEGASAMainLoop MainLoop { 217 get { 218 return (SASEGASAMainLoop)( 219 (ResultsCollector)( 220 (UniformSubScopesProcessor)( 221 (VariableCreator)VillageProcessor.Successor 222 ).Successor 223 ).Successor 224 ).Successor; 225 } 217 get { return FindMainLoop(VillageProcessor.Successor); } 226 218 } 227 219 [Storable] … … 563 555 Analyzer.Operators.Add(selectionPressureAnalyzer); 564 556 } 557 private SASEGASAMainLoop FindMainLoop(IOperator start) { 558 IOperator mainLoop = start; 559 while (mainLoop != null && !(mainLoop is SASEGASAMainLoop)) 560 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 561 if (mainLoop == null) return null; 562 else return (SASEGASAMainLoop)mainLoop; 563 } 565 564 #endregion 566 565 } -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r5356 r5366 136 136 } 137 137 private SimulatedAnnealingMainLoop MainLoop { 138 get { 139 return (SimulatedAnnealingMainLoop)( 140 (ResultsCollector)( 141 (VariableCreator)SolutionsCreator.Successor 142 ).Successor 143 ).Successor; 144 } 138 get { return FindMainLoop(SolutionsCreator.Successor); } 145 139 } 146 140 [Storable] … … 432 426 Analyzer.Operators.Add(qualityAnalyzer); 433 427 } 428 private SimulatedAnnealingMainLoop FindMainLoop(IOperator start) { 429 IOperator mainLoop = start; 430 while (mainLoop != null && !(mainLoop is SimulatedAnnealingMainLoop)) 431 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 432 if (mainLoop == null) return null; 433 else return (SimulatedAnnealingMainLoop)mainLoop; 434 } 434 435 #endregion 435 436 } -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r5356 r5366 135 135 } 136 136 private TabuSearchMainLoop MainLoop { 137 get { 138 return (TabuSearchMainLoop)( 139 (ResultsCollector)( 140 (VariableCreator)SolutionsCreator.Successor 141 ).Successor 142 ).Successor; 143 } 137 get { return FindMainLoop(SolutionsCreator.Successor); } 144 138 } 145 139 [Storable] … … 492 486 } 493 487 } 488 private TabuSearchMainLoop FindMainLoop(IOperator start) { 489 IOperator mainLoop = start; 490 while (mainLoop != null && !(mainLoop is TabuSearchMainLoop)) 491 mainLoop = ((SingleSuccessorOperator)mainLoop).Successor; 492 if (mainLoop == null) return null; 493 else return (TabuSearchMainLoop)mainLoop; 494 } 494 495 #endregion 495 496 }
Note: See TracChangeset
for help on using the changeset viewer.