Class VehicleImpl

java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractVehicle
com.graphhopper.jsprit.core.problem.vehicle.VehicleImpl
All Implemented Interfaces:
HasId, HasIndex, Vehicle

public class VehicleImpl extends AbstractVehicle
Implementation of Vehicle.
Author:
stefan schroeder
  • Method Details

    • copyOf

      public static Vehicle copyOf(Vehicle vehicle)
      Returns a simple copy of vehicle.
      Parameters:
      vehicle - to copy
      Returns:
      copied vehicle
    • createNoVehicle

      public static VehicleImpl.NoVehicle createNoVehicle()
      Returns empty/noVehicle which is a vehicle having no capacity, no type and no reasonable id.

      NoVehicle has id="noVehicle" and extends VehicleImpl

      Returns:
      emptyVehicle
    • toString

      public String toString()
      Returns String with attributes of this vehicle

      String has the following format [attr1=val1][attr2=val2]...[attrn=valn]

      Overrides:
      toString in class Object
    • getEarliestDeparture

      public double getEarliestDeparture()
      Description copied from interface: Vehicle
      Returns the earliest departure of vehicle which should be the lower bound of this vehicle's departure times.
      Returns:
      earliest departure time
    • getLatestArrival

      public double getLatestArrival()
      Description copied from interface: Vehicle
      Returns the latest arrival time at this vehicle's end-location which should be the upper bound of this vehicle's arrival times at end-location.
      Returns:
      latest arrival time of this vehicle
    • getType

      public VehicleType getType()
      Description copied from interface: Vehicle
      Returns the VehicleType of this vehicle.
      Returns:
      VehicleType of this vehicle
    • getId

      public String getId()
      Description copied from interface: Vehicle
      Returns the id of this vehicle.
      Returns:
      id
    • isReturnToDepot

      public boolean isReturnToDepot()
      Description copied from interface: Vehicle
      Returns true if vehicle returns to depot, false otherwise.
      Returns:
      true if isReturnToDepot
    • getStartLocation

      public Location getStartLocation()
    • getEndLocation

      public Location getEndLocation()
    • getSkills

      public Skills getSkills()
    • getBreak

      public Break getBreak()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Two vehicles are equal if they have the same id and if their types are equal.
      Overrides:
      equals in class Object