Class FastVehicleRoutingTransportCostsMatrix.Builder

java.lang.Object
com.graphhopper.jsprit.core.util.FastVehicleRoutingTransportCostsMatrix.Builder
Enclosing class:
FastVehicleRoutingTransportCostsMatrix

public static class FastVehicleRoutingTransportCostsMatrix.Builder extends Object
Builder that builds the matrix.
Author:
schroeder
  • 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 index
      toIndex - to location index
      distance - 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 index
      toIndex - to location index
      time - 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