public class VehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts
VehicleRoutingTransportCosts
in the VehicleRoutingProblem.
Note that you can also use it with distance matrix only (or time matrix). But ones you set a particular distance, this expects distance-entries for all relations. This counts also for a particular time. If the method getTransportCosts(...) is then invoked for a relation, where no distance can be found, an IllegalStateException will be thrown. Thus if you want to only use distances only, do not use addTransportTime(...).
| Modifier and Type | Class and Description |
|---|---|
static class |
VehicleRoutingTransportCostsMatrix.Builder
Builder that builds the matrix.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDistance(Location from,
Location to,
double departureTime,
Vehicle vehicle) |
double |
getDistance(String fromId,
String toId)
Returns the distance fromId to toId.
|
double |
getTransportCost(Location from,
Location to,
double departureTime,
Driver driver,
Vehicle vehicle) |
double |
getTransportTime(Location from,
Location to,
double departureTime,
Driver driver,
Vehicle vehicle) |
getBackwardTransportCost, getBackwardTransportTimepublic double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle)
getTransportTime in interface ForwardTransportTimegetTransportTime in class AbstractForwardVehicleRoutingTransportCostspublic double getDistance(String fromId, String toId)
fromId - from locationIdtoId - to locationIdIllegalStateException - if distance of fromId -> toId is not foundpublic double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle)
getTransportCost in interface ForwardTransportCostgetTransportCost in class AbstractForwardVehicleRoutingTransportCostspublic double getDistance(Location from, Location to, double departureTime, Vehicle vehicle)
getDistance in interface TransportDistancegetDistance in class AbstractForwardVehicleRoutingTransportCostsCopyright © 2013–2024. All rights reserved.