1 package au.gov.amsa.geo.distance;
2
3 import au.gov.amsa.geo.model.Cell;
4 import au.gov.amsa.geo.model.Options;
5
6 public class CellAndDistance {
7 private final Cell cell;
8 private final double distanceNm;
9
10 public CellAndDistance(Cell cell, double distanceNm) {
11 this.cell = cell;
12 this.distanceNm = distanceNm;
13 }
14
15 public Cell getCell() {
16 return cell;
17 }
18
19 public double getDistanceNm() {
20 return distanceNm;
21 }
22
23
24
25
26
27
28
29 public double getTrafficDensity(Options options) {
30 return distanceNm / cell.areaNauticalMiles(options);
31 }
32
33 @Override
34 public String toString() {
35 return "CellAndDistance [cell=" + cell + ", distanceNm=" + distanceNm
36 + "]";
37 }
38
39 }