Changeset 12694 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 3 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.VehicleRouting
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r11303 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. … … 29 29 using HeuristicLab.Data; 30 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 31 32 using HeuristicLab.Parameters; 32 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 42 namespace HeuristicLab.Problems.VehicleRouting { 42 43 [Item("Vehicle Routing Problem", "Represents a Vehicle Routing Problem.")] 43 [Creatable( "Problems")]44 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 110)] 44 45 [StorableClass] 45 46 public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> { … … 113 114 get { return SolutionCreatorParameter.Value; } 114 115 set { SolutionCreatorParameter.Value = value; } 115 }116 private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {117 get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }118 116 } 119 117 #endregion … … 256 254 ApplicationManager.Manager.GetInstances<IGeneralVRPOperator>().Cast<IOperator>()).OrderBy(op => op.Name)); 257 255 Operators.Add(new VRPSimilarityCalculator()); 258 Operators.Add(new SingleObjectivePopulationDiversityAnalyzer()); 256 Operators.Add(new QualitySimilarityCalculator()); 257 Operators.Add(new NoSimilarityCalculator()); 258 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 259 259 260 260 IVRPCreator defaultCreator = null; … … 287 287 op.ParentsParameter.Hidden = true; 288 288 } 289 foreach ( VRPSimilarityCalculator op in Operators.OfType<VRPSimilarityCalculator>()) {289 foreach (ISolutionSimilarityCalculator op in Operators.OfType<ISolutionSimilarityCalculator>()) { 290 290 op.SolutionVariableName = SolutionCreator.VRPToursParameter.ActualName; 291 291 op.QualityVariableName = ProblemInstance.SolutionEvaluator.QualityParameter.ActualName; 292 op.ProblemInstance = ProblemInstance; 293 } 294 if (SingleObjectivePopulationDiversityAnalyzer != null) { 295 SingleObjectivePopulationDiversityAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name; 296 SingleObjectivePopulationDiversityAnalyzer.QualityParameter.ActualName = ProblemInstance.SolutionEvaluator.QualityParameter.ActualName; 297 SingleObjectivePopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results"; 298 SingleObjectivePopulationDiversityAnalyzer.SimilarityCalculator = Operators.OfType<VRPSimilarityCalculator>().SingleOrDefault(); 292 var calc = op as VRPSimilarityCalculator; 293 if (calc != null) calc.ProblemInstance = ProblemInstance; 299 294 } 300 295 }
Note: See TracChangeset
for help on using the changeset viewer.