OptaPlanner distribution 6.2.1-SNAPSHOT

org.optaplanner.examples.vehiclerouting.domain.location
Class Location

java.lang.Object
  extended by org.optaplanner.examples.common.domain.AbstractPersistable
      extended by org.optaplanner.examples.vehiclerouting.domain.location.Location
All Implemented Interfaces:
Serializable, Comparable<AbstractPersistable>
Direct Known Subclasses:
AirLocation, HubSegmentLocation, RoadLocation, RoadSegmentLocation

public abstract class Location
extends AbstractPersistable

See Also:
Serialized Form

Field Summary
protected  double latitude
           
protected  double longitude
           
protected  String name
           
 
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
 
Constructor Summary
Location()
           
Location(long id, double latitude, double longitude)
           
 
Method Summary
 double getAirDistanceDouble(Location location)
           
 double getAngle(Location location)
          The angle relative to the direction EAST.
abstract  int getDistance(Location location)
          The distance's unit of measurement depends on the VehicleRoutingSolution's DistanceType.
 double getLatitude()
           
 double getLongitude()
           
 String getName()
           
 void setLatitude(double latitude)
           
 void setLongitude(double longitude)
           
 void setName(String name)
           
 String toString()
           
 
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
compareTo, getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name

latitude

protected double latitude

longitude

protected double longitude
Constructor Detail

Location

public Location()

Location

public Location(long id,
                double latitude,
                double longitude)
Method Detail

getName

public String getName()

setName

public void setName(String name)

getLatitude

public double getLatitude()

setLatitude

public void setLatitude(double latitude)

getLongitude

public double getLongitude()

setLongitude

public void setLongitude(double longitude)

getDistance

public abstract int getDistance(Location location)
The distance's unit of measurement depends on the VehicleRoutingSolution's DistanceType. It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement.

Parameters:
location - never null
Returns:
a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors

getAirDistanceDouble

public double getAirDistanceDouble(Location location)

getAngle

public double getAngle(Location location)
The angle relative to the direction EAST.

Parameters:
location - never null
Returns:
in Cartesian coordinates

toString

public String toString()
Overrides:
toString in class AbstractPersistable

OptaPlanner distribution 6.2.1-SNAPSHOT

Copyright © 2006-2015 JBoss by Red Hat. All Rights Reserved.