Skip to content

Commit

Permalink
report excessive speeds in kph not m/sec fixes #2086
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Aug 6, 2015
1 parent 356f123 commit be5eeac
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -19,27 +19,28 @@ public class HopSpeedFast extends GraphBuilderAnnotation {

private static final long serialVersionUID = 1L;

public static final String FMT = "Excessive speed of %f m/sec over %fm on route %s trip %s " +
public static final String FMT = "Excessive speed of %f kph over %fm on route %s trip %s " +
"stop sequence %d.";

final float speed;
final float metersPerSecond;

final float distance;

final Trip trip;

final int seq;

public HopSpeedFast(float speed, float distance, Trip trip, int seq){
this.speed = speed;
public HopSpeedFast(float metersPerSecond, float distance, Trip trip, int seq){
this.metersPerSecond = metersPerSecond;
this.distance = distance;
this.trip = trip;
this.seq = seq;
}

@Override
public String getMessage() {
return String.format(FMT, speed, distance, trip.getRoute(), trip, seq);
int kph = (int)(3.6 * metersPerSecond); // convert meters per second to kph
return String.format(FMT, kph, distance, trip.getRoute(), trip, seq);
}

}

0 comments on commit be5eeac

Please sign in to comment.