Changeset 3673


Ignore:
Timestamp:
05/06/10 16:03:30 (12 years ago)
Author:
abeham
Message:

#999

  • updated Island OSGA, SASEGASA
  • minor changes to Island GA and OSGA
Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r3671 r3673  
    438438    private void ParameterizeAnalyzers() {
    439439      islandQualityAnalyzer.ResultsParameter.ActualName = "Results";
    440       foreach (IScopeTreeLookupParameter param in ((IAnalyzer)islandQualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>())
    441           param.Depth = 1;
     440      islandQualityAnalyzer.QualityParameter.Depth = 1;
    442441      qualityAnalyzer.ResultsParameter.ActualName = "Results";
    443       foreach (IScopeTreeLookupParameter param in ((IAnalyzer)qualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>())
    444         param.Depth = 2;
     442      qualityAnalyzer.QualityParameter.Depth = 2;
     443
    445444      if (Problem != null) {
    446445        islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r3662 r3673  
    247247    }
    248248    private BestAverageWorstQualityAnalyzer islandQualityAnalyzer;
    249     //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer;
     249    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     250    private ValueAnalyzer islandSelectionPressureAnalyzer;
     251    private ValueAnalyzer selectionPressureAnalyzer;
    250252    #endregion
    251253
     
    472474    private void InitializeAnalyzers() {
    473475      islandQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
    474       //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer();
     476      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     477      islandSelectionPressureAnalyzer = new ValueAnalyzer();
     478      selectionPressureAnalyzer = new ValueAnalyzer();
    475479      ParameterizeAnalyzers();
    476480    }
     
    516520    private void ParameterizeAnalyzers() {
    517521      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
    519538      if (Problem != null) {
    520539        islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    521540        islandQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    522541        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;
    523546      }
    524547    }
     
    611634      Analyzer.Operators.Clear();
    612635      IslandAnalyzer.Operators.Add(islandQualityAnalyzer);
    613       //Analyzer.Operators.Add(qualityAnalyzer);
     636      IslandAnalyzer.Operators.Add(islandSelectionPressureAnalyzer);
     637      Analyzer.Operators.Add(qualityAnalyzer);
     638      Analyzer.Operators.Add(selectionPressureAnalyzer);
    614639      if (Problem != null) {
    615640        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);
    617644        }
    618         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
    619           Analyzer.Operators.Add(analyzer);
    620645      }
    621646    }
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r3659 r3673  
    233233      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
    234234
     235      resultsCollector1.CopyValue = new BoolValue(false);
    235236      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
    236237      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    237       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    238238      resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));
    239239      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    240240
    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"));
    244243      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    245244
     
    353352      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    354353
    355       resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
    356       resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     354      resultsCollector3.CopyValue = new BoolValue(true);
    357355      resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    358356      resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r3672 r3673  
    151151      resultsCollector1.CopyValue = new BoolValue(false);
    152152      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    153       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    154153      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, "ComparisonFactor"));
    155154      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure"));
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r3662 r3673  
    224224    }
    225225    private BestAverageWorstQualityAnalyzer villageQualityAnalyzer;
    226     //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer;
     226    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     227    private ValueAnalyzer villageSelectionPressureAnalyzer;
     228    private ValueAnalyzer selectionPressureAnalyzer;
    227229    #endregion
    228230
     
    430432    private void InitializeAnalyzers() {
    431433      villageQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
    432       //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer();
     434      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     435      villageSelectionPressureAnalyzer = new ValueAnalyzer();
     436      selectionPressureAnalyzer = new ValueAnalyzer();
    433437      ParameterizeAnalyzers();
    434438    }
     
    454458    private void ParameterizeAnalyzers() {
    455459      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
    457476      if (Problem != null) {
    458477        villageQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    459478        villageQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    460479        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;
    461484      }
    462485    }
     
    521544      Analyzer.Operators.Clear();
    522545      VillageAnalyzer.Operators.Add(villageQualityAnalyzer);
    523       //Analyzer.Operators.Add(qualityAnalyzer);
     546      VillageAnalyzer.Operators.Add(villageSelectionPressureAnalyzer);
     547      Analyzer.Operators.Add(qualityAnalyzer);
     548      Analyzer.Operators.Add(selectionPressureAnalyzer);
    524549      if (Problem != null) {
    525550        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);
    527554        }
    528         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
    529           Analyzer.Operators.Add(analyzer);
    530555      }
    531556    }
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r3659 r3673  
    225225      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
    226226
     227      resultsCollector1.CopyValue = new BoolValue(false);
    227228      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    228       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    229229      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor"));
    230230      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages"));
    231231      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"));
    232233      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    233234
    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"));
    237237      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    238238
     
    362362      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    363363
    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;
    370367
    371368      terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA";
Note: See TracChangeset for help on using the changeset viewer.