Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/13/12 16:51:56 (12 years ago)
Author:
jkarder
Message:

#1899: added population diversity analyzer which uses problem specific similarity calculators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs

    r8334 r8478  
    2424using System.IO;
    2525using System.Linq;
     26using HeuristicLab.Analysis;
    2627using HeuristicLab.Common;
    2728using HeuristicLab.Core;
     
    8384    private TSPPopulationDiversityAnalyzer TSPPopulationDiversityAnalyzer {
    8485      get { return Operators.OfType<TSPPopulationDiversityAnalyzer>().FirstOrDefault(); }
     86    }
     87    private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {
     88      get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }
    8589    }
    8690    #endregion
     
    238242      Operators.Add(new BestTSPSolutionAnalyzer());
    239243      Operators.Add(new TSPAlleleFrequencyAnalyzer());
    240       Operators.Add(new TSPPopulationDiversityAnalyzer());
     244      Operators.Add(new SingleObjectivePopulationDiversityAnalyzer());
    241245      ParameterizeAnalyzers();
    242246      var operators = new HashSet<IPermutationOperator>(new IPermutationOperator[] {
     
    324328        TSPPopulationDiversityAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    325329        TSPPopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results";
     330      }
     331
     332      if (SingleObjectivePopulationDiversityAnalyzer != null) {
     333        SingleObjectivePopulationDiversityAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
     334        SingleObjectivePopulationDiversityAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     335        SingleObjectivePopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results";
     336        SingleObjectivePopulationDiversityAnalyzer.SimilarityCalculator = Operators.OfType<TSPSimilarityCalculator>().SingleOrDefault();
    326337      }
    327338    }
Note: See TracChangeset for help on using the changeset viewer.