summaryrefslogtreecommitdiffstats
path: root/lookup/ScoreElement.java
diff options
context:
space:
mode:
Diffstat (limited to 'lookup/ScoreElement.java')
-rw-r--r--lookup/ScoreElement.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/lookup/ScoreElement.java b/lookup/ScoreElement.java
new file mode 100644
index 0000000..cd7dc09
--- /dev/null
+++ b/lookup/ScoreElement.java
@@ -0,0 +1,44 @@
+package lookup;
+
+import DataStructure.GPScoordinate;
+
+/**
+ * Saves a GPS coordinate from the Lookup. Also stores how often that coordinate
+ * was chosen or hit.
+ *
+ * @author richy
+ *
+ */
+public class ScoreElement implements Comparable<ScoreElement> {
+ public int occurrence; // how often was this coordinate chosen based on
+ // Signalstrength
+ public int ratio_hit; // how often was this coordinate chosen based on
+ // SignalRatio
+ public GPScoordinate gps;
+ private double score; // 0-1
+
+ public ScoreElement(GPScoordinate reference) {
+ gps = reference;
+ }
+
+ public void inc_occurence(GPScoordinate gps) {
+ if (this.gps.equals(gps)) {
+ occurrence++;
+ }
+
+ }
+
+ public String toString() {
+ return ("Hits:" + occurrence + " Coord:" + gps.coord1 + "," + gps.coord2);
+ }
+
+ public int compareTo(ScoreElement e) {
+ if (occurrence < e.occurrence)
+ return -1;
+ else if (occurrence > e.occurrence)
+ return 1;
+ else
+ return 0;
+
+ }
+}