summaryrefslogtreecommitdiffstats
path: root/lookup/ScoreElement.java
blob: cd7dc0993bad9fc9e0050afbc39970ba195b39c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;

	}
}