From c0f00cd9f4db09294cca6c039e925a30a3c41913 Mon Sep 17 00:00:00 2001 From: "dkeen@dkeen-laptop" Date: Sat, 7 Jan 2012 11:39:26 -0800 Subject: [PATCH] Fixed equals method, which was screwing up accuracy improvement algo --- AndroidManifest.xml | 4 ++-- src/com/dougkeen/bart/data/Departure.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 380f724..af5fe0e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="10" + android:versionName="1.1.1" > diff --git a/src/com/dougkeen/bart/data/Departure.java b/src/com/dougkeen/bart/data/Departure.java index 8e3224d..fd1a4eb 100644 --- a/src/com/dougkeen/bart/data/Departure.java +++ b/src/com/dougkeen/bart/data/Departure.java @@ -7,6 +7,7 @@ import com.dougkeen.bart.Line; import com.dougkeen.bart.Station; public class Departure implements Parcelable, Comparable { + private static final int ESTIMATE_EQUALS_TOLERANCE_MILLIS = 59999; private static final int MINIMUM_MERGE_OVERLAP_MILLIS = 10000; public Departure() { @@ -249,11 +250,7 @@ public class Departure implements Parcelable, Comparable { return false; if (line != other.line) return false; - if (maxEstimate != other.maxEstimate) - return false; - if (minEstimate != other.minEstimate) - return false; - if (minutes != other.minutes) + if (Math.abs(maxEstimate - other.maxEstimate) > ESTIMATE_EQUALS_TOLERANCE_MILLIS) return false; if (platform == null) { if (other.platform != null)