Changeset 3673
- Timestamp:
- 05/06/10 16:03:30 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r3671 r3673 438 438 private void ParameterizeAnalyzers() { 439 439 islandQualityAnalyzer.ResultsParameter.ActualName = "Results"; 440 foreach (IScopeTreeLookupParameter param in ((IAnalyzer)islandQualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>()) 441 param.Depth = 1; 440 islandQualityAnalyzer.QualityParameter.Depth = 1; 442 441 qualityAnalyzer.ResultsParameter.ActualName = "Results"; 443 foreach (IScopeTreeLookupParameter param in ((IAnalyzer)qualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>())444 param.Depth = 2; 442 qualityAnalyzer.QualityParameter.Depth = 2; 443 445 444 if (Problem != null) { 446 445 islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r3662 r3673 247 247 } 248 248 private BestAverageWorstQualityAnalyzer islandQualityAnalyzer; 249 //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer; 249 private BestAverageWorstQualityAnalyzer qualityAnalyzer; 250 private ValueAnalyzer islandSelectionPressureAnalyzer; 251 private ValueAnalyzer selectionPressureAnalyzer; 250 252 #endregion 251 253 … … 472 474 private void InitializeAnalyzers() { 473 475 islandQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 474 //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer(); 476 qualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 477 islandSelectionPressureAnalyzer = new ValueAnalyzer(); 478 selectionPressureAnalyzer = new ValueAnalyzer(); 475 479 ParameterizeAnalyzers(); 476 480 } … … 516 520 private void ParameterizeAnalyzers() { 517 521 islandQualityAnalyzer.ResultsParameter.ActualName = "Results"; 518 //qualityAnalyzer.ResultsParameter.ActualName = "Results"; 522 islandQualityAnalyzer.QualityParameter.Depth = 1; 523 qualityAnalyzer.ResultsParameter.ActualName = "Results"; 524 qualityAnalyzer.QualityParameter.Depth = 2; 525 526 islandSelectionPressureAnalyzer.ResultsParameter.ActualName = "Results"; 527 islandSelectionPressureAnalyzer.Name = "SelectionPressure Analyzer"; 528 islandSelectionPressureAnalyzer.ValueParameter.Depth = 0; 529 islandSelectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure"; 530 islandSelectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History"; 531 532 selectionPressureAnalyzer.ResultsParameter.ActualName = "Results"; 533 selectionPressureAnalyzer.Name = "SelectionPressure Analyzer"; 534 selectionPressureAnalyzer.ValueParameter.Depth = 1; 535 selectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure"; 536 selectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History"; 537 519 538 if (Problem != null) { 520 539 islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 521 540 islandQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 522 541 islandQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 542 543 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 544 qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 545 qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 523 546 } 524 547 } … … 611 634 Analyzer.Operators.Clear(); 612 635 IslandAnalyzer.Operators.Add(islandQualityAnalyzer); 613 //Analyzer.Operators.Add(qualityAnalyzer); 636 IslandAnalyzer.Operators.Add(islandSelectionPressureAnalyzer); 637 Analyzer.Operators.Add(qualityAnalyzer); 638 Analyzer.Operators.Add(selectionPressureAnalyzer); 614 639 if (Problem != null) { 615 640 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) { 616 IslandAnalyzer.Operators.Add(analyzer); 641 foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>()) 642 param.Depth = 2; 643 Analyzer.Operators.Add(analyzer); 617 644 } 618 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))619 Analyzer.Operators.Add(analyzer);620 645 } 621 646 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r3659 r3673 233 233 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 234 234 235 resultsCollector1.CopyValue = new BoolValue(false); 235 236 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 236 237 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 237 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));238 238 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results")); 239 239 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 240 240 241 resultsCollector2.Name = "Reference Island Results"; 242 resultsCollector2.CopyValue = new BoolValue(false); 243 resultsCollector2.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results")); 241 resultsCollector2.CopyValue = new BoolValue(true); 242 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 244 243 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 245 244 … … 353 352 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 354 353 355 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 356 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 354 resultsCollector3.CopyValue = new BoolValue(true); 357 355 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 358 356 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3672 r3673 151 151 resultsCollector1.CopyValue = new BoolValue(false); 152 152 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 153 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));154 153 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, "ComparisonFactor")); 155 154 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r3662 r3673 224 224 } 225 225 private BestAverageWorstQualityAnalyzer villageQualityAnalyzer; 226 //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer; 226 private BestAverageWorstQualityAnalyzer qualityAnalyzer; 227 private ValueAnalyzer villageSelectionPressureAnalyzer; 228 private ValueAnalyzer selectionPressureAnalyzer; 227 229 #endregion 228 230 … … 430 432 private void InitializeAnalyzers() { 431 433 villageQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 432 //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer(); 434 qualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 435 villageSelectionPressureAnalyzer = new ValueAnalyzer(); 436 selectionPressureAnalyzer = new ValueAnalyzer(); 433 437 ParameterizeAnalyzers(); 434 438 } … … 454 458 private void ParameterizeAnalyzers() { 455 459 villageQualityAnalyzer.ResultsParameter.ActualName = "Results"; 456 //qualityAnalyzer.ResultsParameter.ActualName = "Results"; 460 villageQualityAnalyzer.QualityParameter.Depth = 1; 461 qualityAnalyzer.ResultsParameter.ActualName = "Results"; 462 qualityAnalyzer.QualityParameter.Depth = 2; 463 464 villageSelectionPressureAnalyzer.ResultsParameter.ActualName = "Results"; 465 villageSelectionPressureAnalyzer.Name = "SelectionPressure Analyzer"; 466 villageSelectionPressureAnalyzer.ValueParameter.Depth = 0; 467 villageSelectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure"; 468 villageSelectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History"; 469 470 selectionPressureAnalyzer.ResultsParameter.ActualName = "Results"; 471 selectionPressureAnalyzer.Name = "SelectionPressure Analyzer"; 472 selectionPressureAnalyzer.ValueParameter.Depth = 1; 473 selectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure"; 474 selectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History"; 475 457 476 if (Problem != null) { 458 477 villageQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 459 478 villageQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 460 479 villageQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 480 481 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 482 qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 483 qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 461 484 } 462 485 } … … 521 544 Analyzer.Operators.Clear(); 522 545 VillageAnalyzer.Operators.Add(villageQualityAnalyzer); 523 //Analyzer.Operators.Add(qualityAnalyzer); 546 VillageAnalyzer.Operators.Add(villageSelectionPressureAnalyzer); 547 Analyzer.Operators.Add(qualityAnalyzer); 548 Analyzer.Operators.Add(selectionPressureAnalyzer); 524 549 if (Problem != null) { 525 550 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) { 526 VillageAnalyzer.Operators.Add(analyzer); 551 foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>()) 552 param.Depth = 2; 553 Analyzer.Operators.Add(analyzer); 527 554 } 528 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))529 Analyzer.Operators.Add(analyzer);530 555 } 531 556 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r3659 r3673 225 225 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 226 226 227 resultsCollector1.CopyValue = new BoolValue(false); 227 228 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 228 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));229 229 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor")); 230 230 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages")); 231 231 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Total Active Villages", null, "VillageCount")); 232 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("VillageResults", "Result set for each village", "Results")); 232 233 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 233 234 234 resultsCollector2.Name = "Reference Village Results"; 235 resultsCollector2.CopyValue = new BoolValue(false); 236 resultsCollector2.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("VillageResults", "Result set for each village", "Results")); 235 resultsCollector2.CopyValue = new BoolValue(true); 236 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 237 237 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 238 238 … … 362 362 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 363 363 364 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 365 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 366 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor")); 367 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages")); 368 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Total Active Villages", null, "VillageCount")); 369 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 364 resultsCollector3.CopyValue = new BoolValue(true); 365 resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 366 resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name; 370 367 371 368 terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA";
Note: See TracChangeset
for help on using the changeset viewer.