Added some discussion on A*.
[ailab2.git] / src / Road.java
blobe83a9bad748292ba1073d2291261affd45ce8a5f
1 public class Road {
2 private int speed;
3 private double distance;
4 private double travelTime;
6 public Road(int speed, double distance) {
7 this.speed = speed;
8 this.distance = distance;
9 this.travelTime = distance / (speed / 3.6);
12 /**
13 * Gets the value of speed
15 * @return the value of speed
17 public final int getSpeed() {
18 return this.speed;
21 /**
22 * Gets the value of distance
24 * @return the value of distance
26 public final double getDistance() {
27 return this.distance;
30 /**
31 * Gets the value of travelTime
33 * @return the value of travelTime
35 public final double getTravelTime() {
36 return this.travelTime;
39 public String toString() {
40 return new Double(this.travelTime).toString();