Changeset 8053 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW
- Timestamp:
- 06/19/12 13:17:29 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluation.cs
r6855 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.Linq;25 using System.Text;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HeuristicLab.Common;28 23 29 24 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 38 33 39 34 public double ArrivalSpareCapacity { 40 get { return arrivalSpareCapacity; 35 get { return arrivalSpareCapacity; } 41 36 } 42 37 43 public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, 38 public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, 44 39 double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity) 45 40 : base(start, end, spareCapacity, tourStartTime, arrivalTime, leaveTime, spareTime, waitingTime) { 46 47 41 this.visited = visited; 42 this.arrivalSpareCapacity = arrivalSpareCapacity; 48 43 } 49 44 } 50 51 public class CVRPPDTWEvaluation : CVRPTWEvaluation {45 46 public class CVRPPDTWEvaluation : CVRPTWEvaluation { 52 47 public int PickupViolations { get; set; } 53 48 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs
r7276 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 26 using HeuristicLab.Data; 27 using HeuristicLab.Parameters; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HeuristicLab.Core;29 using HeuristicLab.Parameters;30 using HeuristicLab.Data;31 using HeuristicLab.Optimization;32 using HeuristicLab.PluginInfrastructure;33 30 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Problems.VehicleRouting.Encodings;35 using HeuristicLab.Common;36 31 37 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 38 33 [Item("CVRPPDTWEvaluator", "Represents a single depot CVRPPDTW evaluator.")] 39 34 [StorableClass] 40 public class CVRPPDTWEvaluator : CVRPTWEvaluator {35 public class CVRPPDTWEvaluator : CVRPTWEvaluator { 41 36 public ILookupParameter<IntValue> PickupViolationsParameter { 42 37 get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; } … … 119 114 double arrivalSpareCapacity = capacity - currentLoad; 120 115 121 bool validPickupDelivery = 116 bool validPickupDelivery = 122 117 validPickupDelivery = 123 118 ((demand[end] >= 0) || … … 134 129 135 130 double spareCapacity = capacity - currentLoad; 136 CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 131 CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 137 132 arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity); 138 133 tourInfo.AddStopInsertionInfo(stopInfo); … … 172 167 } 173 168 174 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 169 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 175 170 out bool feasible) { 176 171 CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo; … … 309 304 PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations; 310 305 } 311 306 312 307 [StorableConstructor] 313 308 protected CVRPPDTWEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs
r7934 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluation.cs
r6855 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HeuristicLab.Common;28 22 29 23 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 34 28 get { return tourStartTime; } 35 29 } 36 30 37 31 private double arrivalTime; 38 32 … … 61 55 public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, double arrivalTime, double leaveTime, double spareTime, double waitingTime) 62 56 : base(start, end, spareCapacity) { 63 64 65 66 67 57 this.tourStartTime = tourStartTime; 58 this.arrivalTime = arrivalTime; 59 this.leaveTime = leaveTime; 60 this.spareTime = spareTime; 61 this.waitingTime = waitingTime; 68 62 } 69 63 } 70 71 public class CVRPTWEvaluation : CVRPEvaluation {64 65 public class CVRPTWEvaluation : CVRPEvaluation { 72 66 public double Tardiness { get; set; } 73 67 public double TravelTime { get; set; } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs
r7276 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 23 using HeuristicLab.Common; 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HeuristicLab.Core;29 using HeuristicLab.Parameters;30 using HeuristicLab.Data;31 using HeuristicLab.Optimization;32 using HeuristicLab.PluginInfrastructure;33 29 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Problems.VehicleRouting.Encodings;35 using HeuristicLab.Common;36 30 37 31 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 38 32 [Item("CVRPTWEvaluator", "Represents a single depot CVRPTW evaluator.")] 39 33 [StorableClass] 40 public class CVRPTWEvaluator : CVRPEvaluator {34 public class CVRPTWEvaluator : CVRPEvaluator { 41 35 public ILookupParameter<DoubleValue> TardinessParameter { 42 36 get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; } … … 55 49 eval.InsertionInfo.AddTourInsertionInfo(tourInfo); 56 50 double originalQuality = eval.Quality; 57 51 58 52 IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance; 59 53 DoubleArray demand = instance.Demand; … … 111 105 currentWaitingTime = readyTime[end] - time; 112 106 113 double waitTime = readyTime[end] -time;107 double waitTime = readyTime[end] - time; 114 108 115 109 waitingTime += currentWaitingTime; … … 225 219 //arrive later than before, probably don't have to wait 226 220 if (nextStop.WaitingTime > 0) { 227 additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime); 221 additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime); 228 222 } 229 223 … … 232 226 double spare = nextStop.SpareTime - additionalTime; 233 227 if (spare < 0) 234 tardiness += -spare; 228 tardiness += -spare; 235 229 } else { 236 230 tardiness += additionalTime; … … 263 257 TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime; 264 258 } 265 259 266 260 [StorableConstructor] 267 261 protected CVRPTWEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
r7934 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.