summaryrefslogtreecommitdiffstats
path: root/lookup/GSMLut.java
diff options
context:
space:
mode:
Diffstat (limited to 'lookup/GSMLut.java')
-rw-r--r--lookup/GSMLut.java88
1 files changed, 88 insertions, 0 deletions
diff --git a/lookup/GSMLut.java b/lookup/GSMLut.java
new file mode 100644
index 0000000..7b87001
--- /dev/null
+++ b/lookup/GSMLut.java
@@ -0,0 +1,88 @@
+package lookup;
+
+import helper.ListGPS;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+import DataStructure.GPScoordinate;
+import DataStructure.GSMMap;
+import DataStructure.SingleBTS;
+
+/**
+ * Throw in one or more MR (BTS-list). Get Score Element with possible
+ * Coordinates. This GSMLut uses ScoreElements to represent coordinates and
+ * their possibility. NOT USED!!!!
+ *
+ * @author richy
+ *
+ */
+public class GSMLut {
+ // private GSMMap map;
+ private SingleBTS[] content;
+ private ArrayList<ILut> lookups = new ArrayList<ILut>();
+
+ /**
+ * Create inverse of map
+ *
+ * @param map
+ * GSMmap to use
+ */
+ public GSMLut(GSMMap map) {
+ // this.map = map;
+ content = map.getUniqueBTSlist(); // check if content also contains
+ // E-Plus arfcn!
+ for (SingleBTS current : content) {
+ // create a LUT for every BTS
+ lookups.add(new BTSLut(current.ARFCN, map, 20, 20));
+ // traverse the whole GSMmap, add values to BTSLut
+ }
+
+ }
+
+ public LinkedList<GPScoordinate> find(List<SingleBTS> MR) {
+ // traverse lookups. Build result array
+ // LinkedList<LinkedList<GPScoordinate>> set = new
+ // LinkedList<LinkedList<GPScoordinate>>();
+ LinkedList<GPScoordinate> set = new LinkedList<GPScoordinate>();
+ for (ILut lut : lookups) {
+ set.addAll(lut.get(MR));
+ // set.add(lut.get(MR));
+ }
+ // no intersect
+ // return ListGPS.intersect(set);
+ return set;
+ }
+
+ /**
+ * Returns Score Elements. No intersect is done. Only common Coordinates are
+ * counted. This should be a better way to start!
+ *
+ * @param MR
+ * @return
+ */
+ public LinkedList<ScoreElement> findWithScore(List<SingleBTS> MR) {
+ LinkedList<GPScoordinate> resultset = find(MR);
+ // get unique coords
+ GPScoordinate[] unique = ListGPS.content(resultset);
+ ArrayList<ScoreElement> scores = new ArrayList<ScoreElement>(
+ unique.length);
+ for (GPScoordinate coord : unique) {
+ scores.add(new ScoreElement(coord));
+ }
+ // score elements are initialized. traverse the whole result set now
+ ListIterator<GPScoordinate> itr = resultset.listIterator();
+ for (int i = 0; i < scores.size(); i++) {
+ while (itr.hasNext()) {
+
+ }
+ // reset itr
+ }
+
+ return null;
+
+ }
+
+}