Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/16/14 14:39:28 (10 years ago)
Author:
pfleck
Message:

#2208

  • Added OrienteeringLocalImprovementOperator parameterization
  • Renamed some stuff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs

    r11193 r11194  
    3737minimize the cost of the tour. As shortening operator a 2-opt is applied. (Schilde et. al. 2009)")]
    3838  [StorableClass]
    39   public class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator {
     39  public class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator {
    4040    #region IGenericLocalImprovementOperator Properties
    4141    public Type ProblemType { get { return typeof(OrienteeringProblem); } }
     
    8181      get { return (ILookupParameter<DoubleValue>)Parameters["FixedPenalty"]; }
    8282    }
    83     public ILookupParameter<IRandom> RandomParameter {
    84       get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    85     }
    8683    #region ILocalImprovementOperator Parameters
    8784    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     
    106103    public OrienteeringLocalImprovementOperator()
    107104      : base() {
     105      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The Orienteering Solution given in path representation."));
    108106      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points."));
    109107      Parameters.Add(new LookupParameter<DoubleArray>("Scores", "The scores of the points."));
     
    112110      Parameters.Add(new LookupParameter<IntValue>("TerminusPoint", "Index of the ending point."));
    113111      Parameters.Add(new LookupParameter<DoubleValue>("FixedPenalty", "The penalty for each visited vertex."));
    114       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    115112      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(150)));
    116113      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated moves."));
     
    130127
    131128    public override IOperation Apply() {
     129      // TODO Use LocalImprovementorOperator Parameters
     130
    132131      int numPoints = ScoresParameter.ActualValue.Length;
    133132      var distances = DistanceMatrixParameter.ActualValue;
     
    136135
    137136      bool optimizationDone = true;
    138       bool isFeasible = true;
    139137
    140138      // Find the maximum distance restriction
     
    227225          if (optimizationDone) break;
    228226
    229           double detour = distances.CalculateInsertionCost(tour, tourPosition, visitablePoints[i], fixedPenalty);
     227          double detour = distances.CalculateInsertionCosts(tour, tourPosition, visitablePoints[i], fixedPenalty);
    230228
    231229          // Determine if including the point does not violate any constraint
     
    255253          if (optimizationDone) break;
    256254
    257           double detour = distances.CalculateReplacementCost(tour, tourPosition, visitablePoints[i]);
     255          double detour = distances.CalculateReplacementCosts(tour, tourPosition, visitablePoints[i]);
    258256
    259257          double oldPointScore = scores[tour[tourPosition]];
Note: See TracChangeset for help on using the changeset viewer.