Class Vehicle
- java.lang.Object
-
- org.optaplanner.examples.common.domain.AbstractPersistable
-
- org.optaplanner.examples.vehiclerouting.domain.Vehicle
-
- All Implemented Interfaces:
Standstill
public class Vehicle extends AbstractPersistable implements Standstill
-
-
Field Summary
Fields Modifier and Type Field Description protected intcapacityprotected Depotdepotprotected CustomernextCustomer-
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCapacity()DepotgetDepot()longgetDistanceTo(Standstill standstill)LocationgetLocation()CustomergetNextCustomer()VehiclegetVehicle()voidsetCapacity(int capacity)voidsetDepot(Depot depot)voidsetNextCustomer(Customer nextCustomer)StringtoString()-
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
getId, setId
-
-
-
-
Constructor Detail
-
Vehicle
public Vehicle()
-
Vehicle
public Vehicle(long id, int capacity, Depot depot)
-
-
Method Detail
-
getCapacity
public int getCapacity()
-
setCapacity
public void setCapacity(int capacity)
-
getDepot
public Depot getDepot()
-
setDepot
public void setDepot(Depot depot)
-
getNextCustomer
public Customer getNextCustomer()
- Specified by:
getNextCustomerin interfaceStandstill- Returns:
- sometimes null
-
setNextCustomer
public void setNextCustomer(Customer nextCustomer)
- Specified by:
setNextCustomerin interfaceStandstill
-
getVehicle
public Vehicle getVehicle()
- Specified by:
getVehiclein interfaceStandstill- Returns:
- sometimes null
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceStandstill- Returns:
- never null
-
getDistanceTo
public long getDistanceTo(Standstill standstill)
- Parameters:
standstill- never null- Returns:
- a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors
-
toString
public String toString()
- Overrides:
toStringin classAbstractPersistable
-
-