mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
replace deprecated methods
This commit is contained in:
parent
335b58d95a
commit
db0cdbe310
61 changed files with 752 additions and 744 deletions
|
|
@ -21,6 +21,7 @@ import jsprit.analysis.toolbox.Plotter.Label;
|
|||
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
|
||||
import jsprit.core.algorithm.VehicleRoutingAlgorithmBuilder;
|
||||
import jsprit.core.algorithm.state.StateManager;
|
||||
import jsprit.core.problem.Location;
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.constraint.ConstraintManager;
|
||||
import jsprit.core.problem.constraint.ServiceDeliveriesFirstConstraint;
|
||||
|
|
@ -33,7 +34,6 @@ import jsprit.core.problem.vehicle.VehicleImpl.Builder;
|
|||
import jsprit.core.problem.vehicle.VehicleType;
|
||||
import jsprit.core.problem.vehicle.VehicleTypeImpl;
|
||||
import jsprit.core.reporting.SolutionPrinter;
|
||||
import jsprit.core.util.Coordinate;
|
||||
import jsprit.core.util.Solutions;
|
||||
import jsprit.util.Examples;
|
||||
|
||||
|
|
@ -58,18 +58,18 @@ public class SimpleVRPWithBackhaulsExample {
|
|||
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
|
||||
*/
|
||||
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
|
||||
vehicleBuilder.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
|
||||
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));
|
||||
vehicleBuilder.setType(vehicleType);
|
||||
VehicleImpl vehicle = vehicleBuilder.build();
|
||||
|
||||
/*
|
||||
* build pickups and deliveries at the required locations, each with a capacity-demand of 1.
|
||||
*/
|
||||
Pickup pickup1 = (Pickup) Pickup.Builder.newInstance("1").addSizeDimension(0, 1).setCoord(Coordinate.newInstance(5, 7)).build();
|
||||
Delivery delivery1 = (Delivery) Delivery.Builder.newInstance("2").addSizeDimension(0, 1).setCoord(Coordinate.newInstance(5, 13)).build();
|
||||
Pickup pickup1 = (Pickup) Pickup.Builder.newInstance("1").addSizeDimension(0, 1).setLocation(Location.newInstance(5, 7)).build();
|
||||
Delivery delivery1 = (Delivery) Delivery.Builder.newInstance("2").addSizeDimension(0, 1).setLocation(Location.newInstance(5, 13)).build();
|
||||
|
||||
Pickup pickup2 = (Pickup) Pickup.Builder.newInstance("3").addSizeDimension(0, 1).setCoord(Coordinate.newInstance(15, 7)).build();
|
||||
Delivery delivery2 = (Delivery) Delivery.Builder.newInstance("4").addSizeDimension(0, 1).setCoord(Coordinate.newInstance(15, 13)).build();
|
||||
Pickup pickup2 = (Pickup) Pickup.Builder.newInstance("3").addSizeDimension(0, 1).setLocation(Location.newInstance(15, 7)).build();
|
||||
Delivery delivery2 = (Delivery) Delivery.Builder.newInstance("4").addSizeDimension(0, 1).setLocation(Location.newInstance(15, 13)).build();
|
||||
|
||||
|
||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue