Changeset 4376 for branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP
- Timestamp:
- 09/09/10 16:24:09 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs
r4363 r4376 49 49 base.EvaluateTour(eval, instance, tour); 50 50 51 I CapacitatedProblemInstance cvrpInstance = instance as ICapacitatedProblemInstance;51 IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance; 52 52 53 53 double delivered = 0.0; … … 55 55 56 56 for (int i = 0; i < tour.Stops.Count; i++) { 57 delivered += instance.Demand[ i];57 delivered += instance.Demand[tour.Stops[i]]; 58 58 } 59 59 60 double capacity = (instance as ICapacitatedProblemInstance).Capacity.Value;60 double capacity = cvrpInstance.Capacity.Value; 61 61 if (delivered > capacity) { 62 62 overweight = delivered - capacity; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
r4374 r4376 36 36 [Item("CVRPProblemInstance", "Represents a single depot CVRP instance.")] 37 37 [StorableClass] 38 public class CVRPProblemInstance: SingleDepotVRPProblemInstance, I CapacitatedProblemInstance {38 public class CVRPProblemInstance: SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance { 39 39 protected IValueParameter<DoubleValue> CapacityParameter { 40 40 get { return (IValueParameter<DoubleValue>)Parameters["Capacity"]; } … … 55 55 protected override IEnumerable<IOperator> GetOperators() { 56 56 return base.GetOperators() 57 .Where(o => o is I CapacitatedOperator).Cast<IOperator>();57 .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>(); 58 58 } 59 59
Note: See TracChangeset
for help on using the changeset viewer.