Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/15 11:18:07 (10 years ago)
Author:
bburlacu
Message:

#2276: Merged trunk changes.

Location:
branches/HeuristicLab.DatasetRefactor/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DatasetRefactor/sources

  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.VehicleRouting

  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.VehicleRouting/3.4/SimilarityCalculators/VRPSimilarityCalculator.cs

    r12031 r12105  
    4040  [StorableClass]
    4141  public sealed class VRPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
    42     #region Properties
     42    protected override bool IsCommutative { get { return true; } }
     43
    4344    [Storable]
    4445    public IVRPProblemInstance ProblemInstance { get; set; }
    45     #endregion
    4646
    4747    private VRPSimilarityCalculator(bool deserializing) : base(deserializing) { }
  • branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r12031 r12105  
    2929using HeuristicLab.Data;
    3030using HeuristicLab.Optimization;
     31using HeuristicLab.Optimization.Operators;
    3132using HeuristicLab.Parameters;
    3233using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    114115      set { SolutionCreatorParameter.Value = value; }
    115116    }
    116     private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {
    117       get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }
    118     }
    119117    #endregion
    120118
     
    256254          ApplicationManager.Manager.GetInstances<IGeneralVRPOperator>().Cast<IOperator>()).OrderBy(op => op.Name));
    257255        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>()));
    259259
    260260        IVRPCreator defaultCreator = null;
     
    287287          op.ParentsParameter.Hidden = true;
    288288        }
    289         foreach (VRPSimilarityCalculator op in Operators.OfType<VRPSimilarityCalculator>()) {
     289        foreach (ISolutionSimilarityCalculator op in Operators.OfType<ISolutionSimilarityCalculator>()) {
    290290          op.SolutionVariableName = SolutionCreator.VRPToursParameter.ActualName;
    291291          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;
    299294        }
    300295      }
Note: See TracChangeset for help on using the changeset viewer.