Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/22/12 11:11:38 (12 years ago)
Author:
jkarder
Message:

#1331:

  • synced branch with trunk
  • added custom interface (ISimilarityBasedOperator) to mark operators that conduct similarity calculation
  • similarity calculators are now parameterized by the algorithm
  • deleted SolutionPool2TierUpdateMethod
  • deleted KnapsackMultipleGuidesPathRelinker
  • moved IImprovementOperator, IPathRelinker and ISimilarityCalculator to HeuristicLab.Optimization
  • added parameter descriptions
  • fixed plugin references
  • fixed count of EvaluatedSolutions
  • fixed check for duplicate solutions
  • minor code improvements
Location:
branches/ScatterSearch (trunk integration)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/Improvers/VRPImprovementOperator.cs

    r7821 r8086  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2526using HeuristicLab.Operators;
    2627using HeuristicLab.Optimization;
    27 using HeuristicLab.Optimization.Operators;
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    110110      : base() {
    111111      #region Create parameters
    112       Parameters.Add(new LookupParameter<DoubleValue>("Capacity"));
    113       Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates"));
    114       Parameters.Add(new ScopeParameter("CurrentScope"));
    115       Parameters.Add(new LookupParameter<DoubleArray>("Demand"));
    116       Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor"));
    117       Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix"));
    118       Parameters.Add(new LookupParameter<DoubleArray>("DueTime"));
    119       Parameters.Add(new LookupParameter<IEvaluator>("Evaluator"));
    120       Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor"));
    121       Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", new IntValue(100)));
    122       Parameters.Add(new ValueParameter<IntValue>("Lambda", new IntValue(1)));
    123       Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty"));
    124       Parameters.Add(new LookupParameter<IRandom>("Random"));
    125       Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime"));
    126       Parameters.Add(new ValueParameter<IntValue>("SampleSize", new IntValue(100)));
    127       Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime"));
    128       Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty"));
    129       Parameters.Add(new ValueLookupParameter<IItem>("Target"));
    130       Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor"));
    131       Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix"));
    132       Parameters.Add(new LookupParameter<IntValue>("Vehicles"));
     112      Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle."));
     113      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
     114      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the solution to be improved."));
     115      Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer."));
     116      Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation."));
     117      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
     118      Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer."));
     119      Parameters.Add(new LookupParameter<IEvaluator>("Evaluator", "The operator used to evaluate solutions."));
     120      Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation."));
     121      Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", "The number of improvement attempts the operator should perform.", new IntValue(100)));
     122      Parameters.Add(new ValueParameter<IntValue>("Lambda", "The number of neighbors that should be exchanged.", new IntValue(1)));
     123      Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation."));
     124      Parameters.Add(new LookupParameter<IRandom>("Random", "A pseudo random number generator."));
     125      Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer."));
     126      Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The number of moves that should be executed.", new IntValue(100)));
     127      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
     128      Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation."));
     129      Parameters.Add(new ValueLookupParameter<IItem>("Target", "This parameter is used for name translation only."));
     130      Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation."));
     131      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false"));
     132      Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles."));
    133133      #endregion
    134134    }
     
    143143        AlbaEncoding.ConvertFrom(TargetParameter.ActualValue as IVRPEncoding, VehiclesParameter.ActualValue.Value, DistanceMatrixParameter);
    144144
     145      if (solution == null)
     146        throw new ArgumentException("Cannot improve solution because it has the wrong type.");
     147
    145148      double quality = -1;
    146149      int evaluatedSolutions;
     
    154157
    155158      TargetParameter.ActualValue = PotvinEncoding.ConvertFrom(solution, DistanceMatrixParameter);
     159      CurrentScopeParameter.ActualValue.Variables.Add(new Variable("LocalEvaluatedSolutions", new IntValue(evaluatedSolutions)));
    156160
    157161      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.