- Timestamp:
- 06/03/14 16:19:44 (11 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10858
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 10858
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs
r10507 r10928 33 33 34 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 35 [Item("PushForwardInsertionCreator", " Creates a randomly initialized VRP solution.")]35 [Item("PushForwardInsertionCreator", "The push forward insertion heuristic. It is implemented as described in Sam, and Thangiah, R. (1999). A Hybrid Genetic Algorithms, Simulated Annealing and Tabu Search Heuristic for Vehicle Routing Problems with Time Windows. Practical Handbook of Genetic Algorithms, Volume III, pp 347–381.")] 36 36 [StorableClass] 37 37 public sealed class PushForwardInsertionCreator : PotvinCreator, IStochasticOperator { … … 138 138 dueTime = 0; 139 139 140 double dist; 141 if (problemInstance.Coordinates[customer + depotCount - 1, 0] < x0) 142 dist = -distance; 143 else 144 dist = distance; 140 double x = problemInstance.Coordinates[customer + depotCount - 1, 0]; 141 double y = problemInstance.Coordinates[customer + depotCount - 1, 1]; 145 142 146 143 double cost = alpha * distance + // distance 0 <-> City[i] 147 -beta * dueTime + // latest arrival time148 -gamma * (Math.Asin((problemInstance.Coordinates[customer + depotCount - 1, 1] - y0) / dist) / 360 * dist); // polar angle144 -beta * dueTime + // latest arrival time 145 -gamma * ((Math.Atan2(y - y0, x - x0) + Math.PI) / (2.0 * Math.PI) * distance); // polar angle 149 146 150 147 if (cost < minCost) {
Note: See TracChangeset
for help on using the changeset viewer.