Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| OptaPlanner distribution 6.2.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.optaplanner.examples.tsp.domain.location
Class AirLocation

    java.lang.Object
      org.optaplanner.examples.common.domain.AbstractPersistable
          org.optaplanner.examples.tsp.domain.location.Location
              org.optaplanner.examples.tsp.domain.location.AirLocation

All Implemented Interfaces:
  Serializable, Comparable<AbstractPersistable>

    public class AirLocation

extends Location

The cost between 2 locations is a straight line: the euclidean distance between their GPS coordinates. Used with `DistanceType.AIR_DISTANCE`.

See Also:
  Serialized Form

Field Summary

Fields inherited from class org.optaplanner.examples.tsp.domain.location.Location
`latitude, longitude, name`

Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
`id`

Constructor Summary
`AirLocation()`
`AirLocation(long id, double latitude, double longitude)`

Method Summary
`long` | `getDistance(Location location)` The distance's unit of measurement depends on the `VehicleRoutingSolution`'s `DistanceType`.

Methods inherited from class org.optaplanner.examples.tsp.domain.location.Location
`getAirDistanceDouble, getAngle, getLatitude, getLongitude, getName, setLatitude, setLongitude, setName, 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`

Constructor Detail

### AirLocation

    public AirLocation()

### AirLocation

    public AirLocation(long id,
                       double latitude,
                       double longitude)

Method Detail

### getDistance

    public long getDistance(Location location)

  Description copied from class: `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.

  Specified by:
    `getDistance` in class `Location`
  Parameters:
    `location` - never null
  Returns:
    a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| OptaPlanner distribution 6.2.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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