|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbasics.VehicleRoutingProblem.Builder
public static class VehicleRoutingProblem.Builder
Builder to build the routing-problem.
| Constructor Summary | |
|---|---|
VehicleRoutingProblem.Builder()
|
|
| Method Summary | |
|---|---|
VehicleRoutingProblem.Builder |
addAllJobs(java.util.Collection<Job> jobs)
Adds a collection of jobs. |
VehicleRoutingProblem.Builder |
addAllVehicles(java.util.Collection<Vehicle> vehicles)
Adds a collection of vehicles. |
VehicleRoutingProblem.Builder |
addJob(Job job)
Adds a job which is either a service or a shipment. |
VehicleRoutingProblem.Builder |
addLocation(java.lang.String id,
Coordinate coord)
|
void |
addProblemConstraint(VehicleRoutingProblem.Constraint constraint)
|
VehicleRoutingProblem.Builder |
addService(Service service)
Adds a service to jobList. |
VehicleRoutingProblem.Builder |
addVehicle(Vehicle vehicle)
Adds a vehicle. |
VehicleRoutingProblem.Builder |
addVehicleType(VehicleType type)
Adds a vehicleType. |
VehicleRoutingProblem |
build()
Builds the VehicleRoutingProblem. |
java.lang.String |
createLocation(double x,
double y)
Create a location (i.e. |
java.util.Collection<Service> |
getAddedServices()
Gets an unmodifiable collection of already added services. |
java.util.Collection<Vehicle> |
getAddedVehicles()
Gets an unmodifiable collection of already added vehicles. |
java.util.Map<java.lang.String,Coordinate> |
getLocationMap()
Returns the unmodifiable map of locations (mapped by their id). |
Locations |
getLocations()
Returns the locations collected by this builder. |
static VehicleRoutingProblem.Builder |
newInstance()
Returns a new instance of this builder. |
VehicleRoutingProblem.Builder |
setActivityCosts(VehicleRoutingActivityCosts activityCosts)
Sets the activityCostFunction that considers also activities on a vehicle-route. |
VehicleRoutingProblem.Builder |
setFleetComposition(VehicleRoutingProblem.FleetComposition fleetComposition)
Sets the fleetComposition. |
VehicleRoutingProblem.Builder |
setFleetSize(VehicleRoutingProblem.FleetSize fleetSize)
Sets the type of fleetSize. |
VehicleRoutingProblem.Builder |
setNeighborhood(Neighborhood neighborhood)
Sets the neighborhood. |
VehicleRoutingProblem.Builder |
setRoutingCost(VehicleRoutingTransportCosts costs)
Sets routing costs. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VehicleRoutingProblem.Builder()
| Method Detail |
|---|
public static VehicleRoutingProblem.Builder newInstance()
public java.lang.String createLocation(double x,
double y)
x - y -
Coordinatepublic java.util.Map<java.lang.String,Coordinate> getLocationMap()
public Locations getLocations()
Locations are cached when adding a shipment, service, depot, vehicle.
public void addProblemConstraint(VehicleRoutingProblem.Constraint constraint)
public VehicleRoutingProblem.Builder setRoutingCost(VehicleRoutingTransportCosts costs)
costs -
VehicleRoutingTransportCostspublic VehicleRoutingProblem.Builder setFleetSize(VehicleRoutingProblem.FleetSize fleetSize)
FleetSize is either FleetSize.INFINITE or FleetSize.FINITE
fleetSize -
public VehicleRoutingProblem.Builder setFleetComposition(VehicleRoutingProblem.FleetComposition fleetComposition)
FleetComposition is either FleetComposition.HETEROGENEOUS or FleetComposition.HOMOGENEOUS
fleetComposition -
public VehicleRoutingProblem.Builder addService(Service service)
If jobList already contains service, a warning message is printed, and the existing job will be overwritten.
service -
public VehicleRoutingProblem.Builder addJob(Job job)
job -
java.lang.IllegalStateException - if job is neither a shipment or a service.public VehicleRoutingProblem.Builder addVehicle(Vehicle vehicle)
vehicle -
public VehicleRoutingProblem.Builder addVehicleType(VehicleType type)
type -
public VehicleRoutingProblem.Builder setNeighborhood(Neighborhood neighborhood)
neighborhood -
public VehicleRoutingProblem.Builder setActivityCosts(VehicleRoutingActivityCosts activityCosts)
Here you can consider missed time-windows for example. By default, this is set to a DefaultVehicleActivityCostFunction.
activityCosts -
VehicleRoutingTransportCosts, DefaultVehicleRouteCostFunctionpublic VehicleRoutingProblem build()
VehicleRoutingProblem.
If VehicleRoutingTransportCosts are not set, CrowFlyCosts is used.
VehicleRoutingProblem
public VehicleRoutingProblem.Builder addLocation(java.lang.String id,
Coordinate coord)
public VehicleRoutingProblem.Builder addAllJobs(java.util.Collection<Job> jobs)
jobs -
public VehicleRoutingProblem.Builder addAllVehicles(java.util.Collection<Vehicle> vehicles)
vehicles -
public java.util.Collection<Vehicle> getAddedVehicles()
public java.util.Collection<Service> getAddedServices()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||