- Timestamp:
- 05/19/14 10:22:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs
r10298 r10858 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.