Package com.graphhopper.jsprit.core.util
Class FastVehicleRoutingTransportCostsMatrix.Builder
java.lang.Object
com.graphhopper.jsprit.core.util.FastVehicleRoutingTransportCostsMatrix.Builder
- Enclosing class:
FastVehicleRoutingTransportCostsMatrix
Builder that builds the matrix.
- Author:
- schroeder
-
Method Summary
Modifier and TypeMethodDescriptionaddTransportDistance(int fromIndex, int toIndex, double distance) Adds a transport-distance for a particular relation.addTransportTime(int fromIndex, int toIndex, double time) Adds transport-time for a particular relation.addTransportTimeAndDistance(int fromIndex, int toIndex, double time, double distance) build()Builds the matrix.newInstance(int noLocations, boolean isSymmetric) Creates a new builder returning the matrix-builder.
-
Method Details
-
newInstance
public static FastVehicleRoutingTransportCostsMatrix.Builder newInstance(int noLocations, boolean isSymmetric) Creates a new builder returning the matrix-builder.If you want to consider symmetric matrices, set isSymmetric to true.
- Parameters:
isSymmetric- true if matrix is symmetric, false otherwise- Returns:
- builder
-
addTransportDistance
public FastVehicleRoutingTransportCostsMatrix.Builder addTransportDistance(int fromIndex, int toIndex, double distance) Adds a transport-distance for a particular relation.- Parameters:
fromIndex- from location indextoIndex- to location indexdistance- the distance to be added- Returns:
- builder
-
addTransportTime
public FastVehicleRoutingTransportCostsMatrix.Builder addTransportTime(int fromIndex, int toIndex, double time) Adds transport-time for a particular relation.- Parameters:
fromIndex- from location indextoIndex- to location indextime- the time to be added- Returns:
- builder
-
addTransportTimeAndDistance
public FastVehicleRoutingTransportCostsMatrix.Builder addTransportTimeAndDistance(int fromIndex, int toIndex, double time, double distance) -
build
Builds the matrix.- Returns:
- matrix
-