Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3671


Ignore:
Timestamp:
05/06/10 14:07:21 (15 years ago)
Author:
abeham
Message:

#999

  • fixed TS, SA and Island GA
Location:
trunk/sources
Files:
3 edited

Legend:

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

    r3662 r3671  
    205205    }
    206206    private BestAverageWorstQualityAnalyzer islandQualityAnalyzer;
    207     //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer;
     207    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
    208208    #endregion
    209209
     
    399399    private void InitializeAnalyzers() {
    400400      islandQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
    401       //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer();
     401      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
    402402      ParameterizeAnalyzers();
    403403    }
     
    438438    private void ParameterizeAnalyzers() {
    439439      islandQualityAnalyzer.ResultsParameter.ActualName = "Results";
    440       //qualityAnalyzer.ResultsParameter.ActualName = "Results";
     440      foreach (IScopeTreeLookupParameter param in ((IAnalyzer)islandQualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>())
     441          param.Depth = 1;
     442      qualityAnalyzer.ResultsParameter.ActualName = "Results";
     443      foreach (IScopeTreeLookupParameter param in ((IAnalyzer)qualityAnalyzer).Parameters.OfType<IScopeTreeLookupParameter>())
     444        param.Depth = 2;
    441445      if (Problem != null) {
    442446        islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    443447        islandQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    444448        islandQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
     449        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     450        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     451        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    445452      }
    446453    }
     
    511518      Analyzer.Operators.Clear();
    512519      IslandAnalyzer.Operators.Add(islandQualityAnalyzer);
    513       //Analyzer.Operators.Add(qualityAnalyzer);
     520      Analyzer.Operators.Add(qualityAnalyzer);
    514521      if (Problem != null) {
     522        /*foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) {
     523          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
     524            param.Depth = 1;
     525          IslandAnalyzer.Operators.Add(analyzer);
     526        }*/
    515527        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) {
    516           IslandAnalyzer.Operators.Add(analyzer);
     528          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
     529            param.Depth = 2;
     530          Analyzer.Operators.Add(analyzer);
    517531        }
    518         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
    519           Analyzer.Operators.Add(analyzer);
    520532      }
    521533    }
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs

    r3662 r3671  
    402402      Analyzer.Operators.Add(qualityAnalyzer);
    403403      if (Problem != null) {
    404         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
     404        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) {
     405          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
     406            param.Depth = 0;
    405407          Analyzer.Operators.Add(analyzer);
     408        }
    406409      }
    407410    }
  • trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs

    r3662 r3671  
    392392      MoveAnalyzer.Operators.Add(tabuNeighborhoodAnalyzer);
    393393      if (Problem != null) {
    394         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
     394        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name)) {
     395          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
     396            param.Depth = 0;
    395397          Analyzer.Operators.Add(analyzer);
     398        }
    396399      }
    397400    }
Note: See TracChangeset for help on using the changeset viewer.