Class AbstractVehicle

java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractVehicle
All Implemented Interfaces:
HasId, HasIndex, Vehicle
Direct Known Subclasses:
VehicleImpl, VehicleImpl.NoVehicle

public abstract class AbstractVehicle extends Object implements Vehicle
AbstractVehicle to handle indeces of vehicles.
  • Constructor Details

    • AbstractVehicle

      public AbstractVehicle()
  • Method Details

    • getUserData

      public Object getUserData()
      Specified by:
      getUserData in interface Vehicle
      Returns:
      User-specific domain data associated with the vehicle
    • setUserData

      protected void setUserData(Object userData)
    • getIndex

      @Deprecated public int getIndex()
      Deprecated.
      Use VehicleRoutingProblem.getVehicleIndex(Vehicle) instead. Vehicle indices are VRP-specific and should not be accessed directly from the vehicle. A vehicle can have different indices in different VRP instances.
      Specified by:
      getIndex in interface HasIndex
    • setIndex

      @Deprecated protected void setIndex(int index)
      Deprecated.
      Vehicle indices are now managed by VehicleRoutingProblem. This method is no longer called by the framework.
    • getVehicleTypeIdentifier

      public VehicleTypeKey getVehicleTypeIdentifier()
      Specified by:
      getVehicleTypeIdentifier in interface Vehicle
    • setVehicleIdentifier

      protected void setVehicleIdentifier(VehicleTypeKey vehicleTypeIdentifier)