public abstract class Location extends AbstractPersistable
Modifier and Type | Field and Description |
---|---|
protected double |
latitude |
protected double |
longitude |
protected String |
name |
id
Constructor and Description |
---|
Location() |
Location(long id,
double latitude,
double longitude) |
Modifier and Type | Method and Description |
---|---|
double |
getAirDistanceDoubleTo(Location location) |
double |
getAngle(Location location)
The angle relative to the direction EAST.
|
abstract long |
getDistanceTo(Location location)
The distance's unit of measurement depends on the
TspSolution 's DistanceType . |
double |
getLatitude() |
double |
getLongitude() |
String |
getName() |
void |
setLatitude(double latitude) |
void |
setLongitude(double longitude) |
void |
setName(String name) |
String |
toString() |
compareTo, getId, setId
protected String name
protected double latitude
protected double longitude
public Location()
public Location(long id, double latitude, double longitude)
public String getName()
public void setName(String name)
public double getLatitude()
public void setLatitude(double latitude)
public double getLongitude()
public void setLongitude(double longitude)
public abstract long getDistanceTo(Location location)
TspSolution
's DistanceType
.
It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement.location
- never nullpublic double getAirDistanceDoubleTo(Location location)
public double getAngle(Location location)
location
- never nullpublic String toString()
toString
in class AbstractPersistable
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.