Class VehicleImpl
java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractVehicle
com.graphhopper.jsprit.core.problem.vehicle.VehicleImpl
Implementation of
Vehicle.- Author:
- stefan schroeder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder that builds the vehicle.static classExtension ofVehicleImplrepresenting an unspecified vehicle with the id 'noVehicle' (to avoid null).Nested classes/interfaces inherited from class com.graphhopper.jsprit.core.problem.AbstractVehicle
AbstractVehicle.AbstractTypeKey -
Method Summary
Modifier and TypeMethodDescriptionstatic VehicleReturns a simple copy of vehicle.static VehicleImpl.NoVehicleReturns empty/noVehicle which is a vehicle having no capacity, no type and no reasonable id.booleanTwo vehicles are equal if they have the same id and if their types are equal.getBreak()doubleReturns the earliest departure of vehicle which should be the lower bound of this vehicle's departure times.getId()Returns the id of this vehicle.doubleReturns 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.getType()Returns theVehicleTypeof this vehicle.inthashCode()booleanReturns true if vehicle returns to depot, false otherwise.toString()Returns String with attributes of this vehicleMethods inherited from class com.graphhopper.jsprit.core.problem.AbstractVehicle
getIndex, getUserData, getVehicleTypeIdentifier, setIndex, setUserData, setVehicleIdentifier
-
Method Details
-
copyOf
Returns a simple copy of vehicle.- Parameters:
vehicle- to copy- Returns:
- copied vehicle
-
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
Returns String with attributes of this vehicleString has the following format [attr1=val1][attr2=val2]...[attrn=valn]
-
getEarliestDeparture
public double getEarliestDeparture()Description copied from interface:VehicleReturns 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:VehicleReturns 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
Description copied from interface:VehicleReturns theVehicleTypeof this vehicle.- Returns:
VehicleTypeof this vehicle
-
getId
Description copied from interface:VehicleReturns the id of this vehicle.- Returns:
- id
-
isReturnToDepot
public boolean isReturnToDepot()Description copied from interface:VehicleReturns true if vehicle returns to depot, false otherwise.- Returns:
- true if isReturnToDepot
-
getStartLocation
-
getEndLocation
-
getSkills
-
getBreak
-
hashCode
public int hashCode() -
equals
Two vehicles are equal if they have the same id and if their types are equal.
-