Changeset 12694 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 30 30 using HeuristicLab.Encodings.PermutationEncoding; 31 31 using HeuristicLab.Optimization; 32 using HeuristicLab.Optimization.Operators; 32 33 using HeuristicLab.Parameters; 33 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 37 38 namespace HeuristicLab.Problems.TravelingSalesman { 38 39 [Item("Traveling Salesman Problem", "Represents a symmetric Traveling Salesman Problem.")] 39 [Creatable( "Problems")]40 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 100)] 40 41 [StorableClass] 41 42 public sealed class TravelingSalesmanProblem : SingleObjectiveHeuristicOptimizationProblem<ITSPEvaluator, IPermutationCreator>, IStorableContent, … … 81 82 private TSPAlleleFrequencyAnalyzer TSPAlleleFrequencyAnalyzer { 82 83 get { return Operators.OfType<TSPAlleleFrequencyAnalyzer>().FirstOrDefault(); } 83 }84 private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {85 get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }86 84 } 87 85 #endregion … … 236 234 Operators.Add(new TSPSimultaneousPathRelinker()); 237 235 Operators.Add(new TSPSimilarityCalculator()); 236 Operators.Add(new QualitySimilarityCalculator()); 237 Operators.Add(new NoSimilarityCalculator()); 238 238 239 239 Operators.Add(new BestTSPSolutionAnalyzer()); 240 240 Operators.Add(new TSPAlleleFrequencyAnalyzer()); 241 Operators.Add(new SingleObjectivePopulationDiversityAnalyzer());241 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 242 242 ParameterizeAnalyzers(); 243 243 var operators = new HashSet<IPermutationOperator>(new IPermutationOperator[] { … … 319 319 TSPAlleleFrequencyAnalyzer.ResultsParameter.ActualName = "Results"; 320 320 } 321 322 if (SingleObjectivePopulationDiversityAnalyzer != null) {323 SingleObjectivePopulationDiversityAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;324 SingleObjectivePopulationDiversityAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;325 SingleObjectivePopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results";326 SingleObjectivePopulationDiversityAnalyzer.SimilarityCalculator = Operators.OfType<TSPSimilarityCalculator>().SingleOrDefault();327 }328 321 } 329 322 private void ParameterizeOperators() { … … 366 359 op.ParentsParameter.Hidden = true; 367 360 } 368 foreach ( TSPSimilarityCalculator op in Operators.OfType<TSPSimilarityCalculator>()) {361 foreach (ISolutionSimilarityCalculator op in Operators.OfType<ISolutionSimilarityCalculator>()) { 369 362 op.SolutionVariableName = SolutionCreator.PermutationParameter.ActualName; 370 363 op.QualityVariableName = Evaluator.QualityParameter.ActualName;
Note: See TracChangeset
for help on using the changeset viewer.