Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7793


Ignore:
Timestamp:
05/10/12 18:05:40 (13 years ago)
Author:
jkarder
Message:

#1331:

  • added operators for the VehicleRouting problem
  • minor code improvements
Location:
branches/ScatterSearch (trunk integration)
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3/SimilarityCalculator.cs

    r7789 r7793  
    6565
    6666      if (left == right) return 0;
    67       else return CalculateDiversity(left, right);
     67      else return CalculateSimilarity(left, right);
    6868    }
    6969
    70     protected abstract double CalculateDiversity(IScope left, IScope right);
     70    protected abstract double CalculateSimilarity(IScope left, IScope right);
    7171  }
    7272}
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.Knapsack/3.3/SimilarityCalculators/KnapsackSimilarityCalculator.cs

    r7789 r7793  
    4242    }
    4343
    44     protected override double CalculateDiversity(IScope left, IScope right) {
     44    protected override double CalculateSimilarity(IScope left, IScope right) {
    4545      BinaryVector sol1 = left.Variables[TargetParameter.ActualName].Value as BinaryVector;
    4646      BinaryVector sol2 = right.Variables[TargetParameter.ActualName].Value as BinaryVector;
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/SimilarityCalculators/SingleObjectiveTestFunctionSimilarityCalculator.cs

    r7789 r7793  
    6363    }
    6464
    65     protected override double CalculateDiversity(IScope left, IScope right) {
     65    protected override double CalculateSimilarity(IScope left, IScope right) {
    6666      RealVector sol1 = left.Variables["Point"].Value as RealVector;
    6767      RealVector sol2 = right.Variables["Point"].Value as RealVector;
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs

    r7789 r7793  
    4242    }
    4343
    44     protected override double CalculateDiversity(IScope left, IScope right) {
     44    protected override double CalculateSimilarity(IScope left, IScope right) {
    4545      Permutation v1 = left.Variables[TargetParameter.ActualName].Value as Permutation;
    4646      Permutation v2 = right.Variables[TargetParameter.ActualName].Value as Permutation;
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj

    r6866 r7793  
    119119    <Compile Include="Encodings\Potvin\Crossovers\PotvinInsertionBasedCrossover.cs" />
    120120    <Compile Include="Encodings\Potvin\Manipulators\PotvinLocalSearchManipulator.cs" />
     121    <Compile Include="Improvers\VRPImprovementOperator.cs" />
    121122    <Compile Include="Interfaces\IVRPMultiNeighborhoodShakingOperator.cs" />
     123    <Compile Include="PathRelinkers\VRPPathRelinker.cs" />
    122124    <Compile Include="Plugin.cs" />
    123125    <Compile Include="ShakingOperators\VehicleRoutingShakingOperator.cs" />
     126    <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" />
    124127    <Compile Include="SolutionParser.cs" />
    125128    <Compile Include="Encodings\Alba\Crossovers\AlbaPermutationCrossover.cs" />
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs

    r7351 r7793  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Optimization;
     29using HeuristicLab.Optimization.Operators;
    2930using HeuristicLab.Parameters;
    3031using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    411412
    412413    private void InitializeOperators() {
     414      Operators.Add(new VRPImprovementOperator());
     415      Operators.Add(new VRPPathRelinker());
     416      Operators.Add(new VRPSimilarityCalculator());
     417
    413418      Operators.Add(new BestVRPSolutionAnalyzer());
    414419      Operators.Add(new BestAverageWorstVRPToursAnalyzer());
     
    518523        op.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    519524      }
     525      foreach (IImprovementOperator op in Operators.OfType<IImprovementOperator>()) {
     526        op.TargetParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     527        op.TargetParameter.Hidden = true;
     528      }
     529      foreach (IPathRelinker op in Operators.OfType<IPathRelinker>()) {
     530        op.ParentsParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     531        op.ParentsParameter.Hidden = true;
     532      }
     533      foreach (ISimilarityCalculator op in Operators.OfType<ISimilarityCalculator>()) {
     534        op.TargetParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     535        op.TargetParameter.Hidden = true;
     536      }
    520537    }
    521538    private void ClearDistanceMatrix() {
Note: See TracChangeset for help on using the changeset viewer.