protected override void Interpret(IVRPData data, IVRPProblemInstance problemInstance) { MDCVRPData cvrpData = (MDCVRPData)data; MDCVRPProblemInstance problem = (MDCVRPProblemInstance)problemInstance; if (cvrpData.Coordinates != null) { problem.Coordinates = new DoubleMatrix(cvrpData.Coordinates); } if (cvrpData.MaximumVehicles != null) { problem.Vehicles.Value = (int)cvrpData.MaximumVehicles; } else { problem.Vehicles.Value = cvrpData.Dimension - 1; } problem.Capacity = new DoubleArray(cvrpData.Capacity); problem.Demand = new DoubleArray(cvrpData.Demands); if (cvrpData.DistanceMeasure != DistanceMeasure.Euclidean) { problem.UseDistanceMatrix.Value = true; problem.DistanceMatrix = new DoubleMatrix(cvrpData.GetDistanceMatrix()); } problem.Depots.Value = cvrpData.Depots; problem.VehicleDepotAssignment = new IntArray(cvrpData.VehicleDepotAssignment); }
protected override void Interpret(IVRPData data, IVRPProblemInstance problemInstance) { base.Interpret(data, problemInstance); PDPTWData pdpData = (PDPTWData)data; CVRPPDTWProblemInstance problem = (CVRPPDTWProblemInstance)problemInstance; problem.PickupDeliveryLocation = new IntArray(pdpData.PickupDeliveryLocations); }
protected override void Interpret(IVRPData data, IVRPProblemInstance problemInstance) { base.Interpret(data, problemInstance); MDCVRPTWData cvrptwData = (MDCVRPTWData)data; MDCVRPTWProblemInstance problem = (MDCVRPTWProblemInstance)problemInstance; problem.ReadyTime = new DoubleArray(cvrptwData.ReadyTimes); problem.ServiceTime = new DoubleArray(cvrptwData.ServiceTimes); problem.DueTime = new DoubleArray(cvrptwData.DueTimes); }