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 int
capacity
protected Depot
depot
protected Customer
nextCustomer
-
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCapacity()
Depot
getDepot()
long
getDistanceTo(Standstill standstill)
Location
getLocation()
Customer
getNextCustomer()
Vehicle
getVehicle()
void
setCapacity(int capacity)
void
setDepot(Depot depot)
void
setNextCustomer(Customer nextCustomer)
String
toString()
-
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:
getNextCustomer
in interfaceStandstill
- Returns:
- sometimes null
-
setNextCustomer
public void setNextCustomer(Customer nextCustomer)
- Specified by:
setNextCustomer
in interfaceStandstill
-
getVehicle
public Vehicle getVehicle()
- Specified by:
getVehicle
in interfaceStandstill
- Returns:
- sometimes null
-
getLocation
public Location getLocation()
- Specified by:
getLocation
in 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:
toString
in classAbstractPersistable
-
-