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:
parent
a0d6ddbc5c
commit
b92533edaf
1 changed files with 19 additions and 0 deletions
|
|
@ -110,6 +110,25 @@ public class VehicleRoute {
|
|||
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 Driver driver;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue