Class PlanningVisit
- java.lang.Object
-
- org.optaweb.vehiclerouting.plugin.planner.domain.PlanningVisit
-
- All Implemented Interfaces:
Standstill
public class PlanningVisit extends Object implements Standstill
-
-
Constructor Summary
Constructors Constructor Description PlanningVisit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdistanceFromPreviousStandstill()Distance from the previous standstill to this visit.longdistanceToDepot()Distance from this visit back to the depot.intgetDemand()longgetId()PlanningLocationgetLocation()The standstill's location.PlanningVisitgetNextVisit()The next visit after this standstill.StandstillgetPreviousStandstill()PlanningVehiclegetVehicle()booleanisLast()Whether this visit is the last in a chain.voidsetDemand(int demand)voidsetId(long id)voidsetLocation(PlanningLocation location)voidsetNextVisit(PlanningVisit nextVisit)voidsetPreviousStandstill(Standstill previousStandstill)voidsetVehicle(PlanningVehicle vehicle)StringtoString()
-
-
-
Method Detail
-
getId
public long getId()
-
setId
public void setId(long id)
-
getLocation
public PlanningLocation getLocation()
Description copied from interface:StandstillThe standstill's location.- Specified by:
getLocationin interfaceStandstill- Returns:
- never
null
-
setLocation
public void setLocation(PlanningLocation location)
-
getDemand
public int getDemand()
-
setDemand
public void setDemand(int demand)
-
getPreviousStandstill
public Standstill getPreviousStandstill()
-
setPreviousStandstill
public void setPreviousStandstill(Standstill previousStandstill)
-
getNextVisit
public PlanningVisit getNextVisit()
Description copied from interface:StandstillThe next visit after this standstill.- Specified by:
getNextVisitin interfaceStandstill- Returns:
- sometimes
null
-
setNextVisit
public void setNextVisit(PlanningVisit nextVisit)
- Specified by:
setNextVisitin interfaceStandstill
-
getVehicle
public PlanningVehicle getVehicle()
-
setVehicle
public void setVehicle(PlanningVehicle vehicle)
-
distanceFromPreviousStandstill
public long distanceFromPreviousStandstill()
Distance from the previous standstill to this visit. This is used to calculate the travel cost of a chain beginning with a vehicle (at a depot) and ending with thelastvisit. The chain ends with a visit, not a depot so the cost of returning from the last visit back to the depot has to be added in a separate step usingdistanceToDepot().- Returns:
- distance from previous standstill to this visit
-
distanceToDepot
public long distanceToDepot()
Distance from this visit back to the depot.- Returns:
- distance from this visit back its vehicle's depot
-
isLast
public boolean isLast()
Whether this visit is the last in a chain.- Returns:
- true, if this visit has no
nextvisit
-
-