Changeset 12721 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Shakers
- Timestamp:
- 07/10/15 16:38:17 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3
- Property svn:ignore
-
old new 2 2 obj 3 3 Plugin.cs 4 *.DotSettings
-
- Property svn:ignore
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Shakers/OrienteeringShakingOperator.cs
r11320 r12721 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. … … 32 32 33 33 namespace HeuristicLab.Problems.Orienteering { 34 [Item("OrienteeringShakingOperator", @"The used neighborhood operator is based on a two point exchange move. A move in 35 the k-th neighborhood consists of removing k consecutive vertices from the tour, starting 36 at a randomly selected position. Afterwards, a sorted list of all vertices not yet included 37 in the current tour is built. The vertices are sorted in descending order with respect to the 38 objective value increase using the current weights. Out of the first three entries with the 39 highest ranking in this list, one randomly selected vertex is reinserted into the current tour 40 at the same position as the removed vertices. This way, l new vertices are inserted into the 41 tour. The largest neighborhood is a complete exchange of all vertices on the tour. 42 The shaking procedure does not guarantee that the new tour does not exceed the cost 43 limit Tmax. Therefore, in a repair step, a sorted list of all vertices in the tour is created. The 44 vertices are sorted in descending order with respect to costs saved when removing the vertex 45 from the tour. Vertices are removed as long as the cost limit is violated. 46 (Schilde et. al. 2009)")] 34 /// <summary> 35 /// The used neighborhood operator is based on a two point exchange move. A move in 36 /// the k-th neighborhood consists of removing k consecutive vertices from the tour, starting 37 /// at a randomly selected position. Afterwards, a sorted list of all vertices not yet included 38 /// in the current tour is built. The vertices are sorted in descending order with respect to the 39 /// objective value increase using the current weights. Out of the first three entries with the 40 /// highest ranking in this list, one randomly selected vertex is reinserted into the current tour 41 /// at the same position as the removed vertices. This way, l new vertices are inserted into the 42 /// tour. The largest neighborhood is a complete exchange of all vertices on the tour. 43 /// The shaking procedure does not guarantee that the new tour does not exceed the cost 44 /// limit Tmax. Therefore, in a repair step, a sorted list of all vertices in the tour is created. The 45 /// vertices are sorted in descending order with respect to costs saved when removing the vertex 46 /// from the tour. Vertices are removed as long as the cost limit is violated. 47 /// (Schilde et. al. 2009) 48 /// </summary> 49 [Item("OrienteeringShakingOperator", @"Implements the shaking procedure described in Schilde M., Doerner K.F., Hartl R.F., Kiechle G. 2009. Metaheuristics for the bi-objective orienteering problem. Swarm Intelligence, Volume 3, Issue 3, pp 179-201.")] 47 50 [StorableClass] 48 51 public sealed class OrienteeringShakingOperator : SingleSuccessorOperator, IMultiNeighborhoodShakingOperator, IStochasticOperator { … … 131 134 int maximumNeighborhood = initialTour.Length - 2; // neighborhood limit within [0, changable tour length - 1) 132 135 maximumNeighborhood = (maximumNeighborhood > currentNeighborhood) ? currentNeighborhood : maximumNeighborhood; 133 int neighborhood = maximumNeighborhood; //random.Next(maximumNeighborhood) + 1;136 int neighborhood = maximumNeighborhood; 134 137 135 138 // Find all points that are not yet included in the tour and are … … 165 168 return base.Apply(); 166 169 } 170 167 171 private void InsertPoints(List<int> actualTour, IntegerVector initialTour, 168 172 int neighborhood, List<int> visitablePoints, IRandom random) { … … 208 212 } 209 213 } 214 210 215 private void CleanupTour(List<int> actualTour, DistanceMatrix distances, double maxDistance, double pointVisitingCosts) { 211 216 // Sort the points on the tour according to their costs savings when removed … … 235 240 } 236 241 } 237 // 242 238 243 private class SavingInfo { 239 244 public int Index;
Note: See TracChangeset
for help on using the changeset viewer.