public static class VehicleRoutingProblem.Builder extends Object
| Constructor and Description |
|---|
Builder() |
public static VehicleRoutingProblem.Builder newInstance()
public Map<String,Coordinate> getLocationMap()
public Locations getLocations()
Locations are cached when adding a shipment, service, depot, vehicle.
public VehicleRoutingProblem.Builder setRoutingCost(VehicleRoutingTransportCosts costs)
costs - the routingCostsVehicleRoutingTransportCostspublic VehicleRoutingProblem.Builder setJobActivityFactory(JobActivityFactory jobActivityFactory)
public VehicleRoutingProblem.Builder setFleetSize(VehicleRoutingProblem.FleetSize fleetSize)
FleetSize is either FleetSize.INFINITE or FleetSize.FINITE. By default it is FleetSize.INFINITE.
fleetSize - the fleet size used in this problem. it can either be FleetSize.INFINITE or FleetSize.FINITEpublic VehicleRoutingProblem.Builder addJob(Job job)
Note that job.getId() must be unique, i.e. no job (either it is a shipment or a service) is allowed to have an already allocated id.
job - job to be addedIllegalStateException - if job is neither a shipment nor a service, or jobId has already been added.public VehicleRoutingProblem.Builder addJob(AbstractJob job)
Note that job.getId() must be unique, i.e. no job (either it is a shipment or a service) is allowed to have an already allocated id.
job - job to be addedIllegalStateException - if job is neither a shipment nor a service, or jobId has already been added.public VehicleRoutingProblem.Builder addInitialVehicleRoute(VehicleRoute route)
route - initial routepublic VehicleRoutingProblem.Builder addInitialVehicleRoutes(Collection<VehicleRoute> routes)
routes - initial routespublic VehicleRoutingProblem.Builder addVehicle(Vehicle vehicle)
vehicle - vehicle to be addedpublic VehicleRoutingProblem.Builder addVehicle(AbstractVehicle vehicle)
vehicle - vehicle to be addedpublic VehicleRoutingProblem.Builder setActivityCosts(VehicleRoutingActivityCosts activityCosts)
By default it is set to zero.
activityCosts - activity costs of the problemVehicleRoutingActivityCostspublic VehicleRoutingProblem build()
VehicleRoutingProblem.
If VehicleRoutingTransportCosts are not set, CrowFlyCosts is used.
VehicleRoutingProblem@Deprecated public VehicleRoutingProblem.Builder addLocation(String locationId, Coordinate coordinate)
public VehicleRoutingProblem.Builder addAllJobs(Collection<? extends Job> jobs)
jobs - which is a collection of jobs that subclasses Jobpublic VehicleRoutingProblem.Builder addAllVehicles(Collection<? extends Vehicle> vehicles)
vehicles - vehicles to be addedpublic Collection<Vehicle> getAddedVehicles()
public Collection<VehicleType> getAddedVehicleTypes()
public Collection<Job> getAddedJobs()
Copyright © 2013–2019. All rights reserved.