1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

added .newInstance(..) factory-method in

core.problem.solution.route.VehicleRoute.Builder to construct a builder
without defining Driver
This commit is contained in:
oblonski 2014-04-25 23:35:41 +02:00
parent a0d6ddbc5c
commit b92533edaf

View file

@ -110,6 +110,25 @@ public class VehicleRoute {
return new Builder(vehicle,driver); return new Builder(vehicle,driver);
} }
/**
* Returns new instance of this builder.
*
* <p><b>Construction-settings of vehicleRoute:</b>
* <p>startLocation == vehicle.getStartLocationId()
* <p>endLocation == vehicle.getEndLocationId()
* <p>departureTime == vehicle.getEarliestDepartureTime()
* <p>latestStart == Double.MAX_VALUE
* <p>earliestEnd == 0.0
*
* @param vehicle
* @param driver
* @return this builder
*/
public static Builder newInstance(Vehicle vehicle){
if(vehicle == null) throw new IllegalArgumentException("null arguments not accepted. ini emptyRoute with VehicleImpl.createNoVehicle() and DriverImpl.noDriver()");
return new Builder(vehicle,DriverImpl.noDriver());
}
private Vehicle vehicle; private Vehicle vehicle;
private Driver driver; private Driver driver;