Class Customer
- java.lang.Object
-
- org.optaplanner.examples.common.domain.AbstractPersistable
-
- org.optaplanner.examples.vehiclerouting.domain.Customer
-
- All Implemented Interfaces:
Standstill
- Direct Known Subclasses:
TimeWindowedCustomer
public class Customer extends AbstractPersistable implements Standstill
-
-
Field Summary
Fields Modifier and Type Field Description protected intdemandprotected Locationlocationprotected CustomernextCustomerprotected StandstillpreviousStandstillprotected Vehiclevehicle-
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDemand()longgetDistanceFrom(Standstill standstill)longgetDistanceFromPreviousStandstill()longgetDistanceTo(Standstill standstill)LocationgetLocation()CustomergetNextCustomer()StandstillgetPreviousStandstill()VehiclegetVehicle()voidsetDemand(int demand)voidsetLocation(Location location)voidsetNextCustomer(Customer nextCustomer)voidsetPreviousStandstill(Standstill previousStandstill)voidsetVehicle(Vehicle vehicle)StringtoString()-
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
getId, setId
-
-
-
-
Field Detail
-
location
protected Location location
-
demand
protected int demand
-
previousStandstill
protected Standstill previousStandstill
-
nextCustomer
protected Customer nextCustomer
-
vehicle
protected Vehicle vehicle
-
-
Constructor Detail
-
Customer
public Customer()
-
Customer
public Customer(long id, Location location, int demand)
-
-
Method Detail
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceStandstill- Returns:
- never null
-
setLocation
public void setLocation(Location location)
-
getDemand
public int getDemand()
-
setDemand
public void setDemand(int demand)
-
getPreviousStandstill
public Standstill getPreviousStandstill()
-
setPreviousStandstill
public void setPreviousStandstill(Standstill previousStandstill)
-
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
-
setVehicle
public void setVehicle(Vehicle vehicle)
-
getDistanceFromPreviousStandstill
public long getDistanceFromPreviousStandstill()
- Returns:
- a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors
-
getDistanceFrom
public long getDistanceFrom(Standstill standstill)
- Parameters:
standstill- never null- Returns:
- a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors
-
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
-
-