Changeset 4068 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPushForwardInsertionCreator.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPushForwardInsertionCreator.cs
r3938 r4068 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq;25 using System.Text;26 using HeuristicLab.Operators;27 24 using HeuristicLab.Core; 28 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.PermutationEncoding; 27 using HeuristicLab.Optimization; 29 28 using HeuristicLab.Parameters; 30 using HeuristicLab.Encodings.PermutationEncoding;31 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Common;33 using HeuristicLab.Optimization;34 30 35 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 195 191 gamma = N(Gamma.Value.Value, Math.Sqrt(GammaVariance.Value.Value), RandomParameter.ActualValue); 196 192 197 double x0 = CoordinatesParameter.ActualValue[0, 0];198 double y0 = CoordinatesParameter.ActualValue[0, 1];193 double x0 = CoordinatesParameter.ActualValue[0, 0]; 194 double y0 = CoordinatesParameter.ActualValue[0, 1]; 199 195 double distance = 0; 200 196 double cost = 0; … … 212 208 for (int i = 1; i <= CitiesParameter.ActualValue.Value; i++) { 213 209 distance = Distance(i, 0); 214 if (CoordinatesParameter.ActualValue[i, 0] < x0) distance = -distance;210 if (CoordinatesParameter.ActualValue[i, 0] < x0) distance = -distance; 215 211 cost = -alpha * distance + // distance 0 <-> City[i] 216 212 beta * (DueTimeParameter.ActualValue[i]) + // latest arrival time 217 gamma * (Math.Asin((CoordinatesParameter.ActualValue[i, 1] - y0) / distance) / 360 * distance); // polar angle213 gamma * (Math.Asin((CoordinatesParameter.ActualValue[i, 1] - y0) / distance) / 360 * distance); // polar angle 218 214 219 215 index = 0;
Note: See TracChangeset
for help on using the changeset viewer.