summaryrefslogtreecommitdiffstats
path: root/MapSearch.java
diff options
context:
space:
mode:
Diffstat (limited to 'MapSearch.java')
-rw-r--r--MapSearch.java123
1 files changed, 123 insertions, 0 deletions
diff --git a/MapSearch.java b/MapSearch.java
new file mode 100644
index 0000000..29eef01
--- /dev/null
+++ b/MapSearch.java
@@ -0,0 +1,123 @@
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.LinkedList;
+
+import lookup.ResultScore;
+import lookup.ScoreElement;
+import DataStructure.GSMMap;
+import DataStructure.SingleBTS;
+import Parse.NMEAParse;
+import Parse.sqlreader;
+
+public class MapSearch {
+
+ /**
+ * @param args
+ * @throws SQLException
+ * @throws ClassNotFoundException
+ */
+ public static void main(String[] args) throws ClassNotFoundException,
+ SQLException {
+ NMEAParse nmea = new NMEAParse("campus7 - E-Plus.log");
+ sqlreader sql = new sqlreader(nmea, 262026003662195l, 3000l);
+ GSMMap map = new GSMMap(sql, 0.00004);
+ map.average();
+ for (int times = 0; times < 9; times++) {
+ map.extrapolate(3);
+ }
+
+ ResultScore score = new ResultScore(map);
+ LinkedList<SingleBTS> MR = getMR_greenhouse();
+ Date start = new Date();
+ ArrayList<ScoreElement> hits = score.find(MR, 15);
+ Date stop = new Date();
+ Collections.sort(hits);
+ for (int i = 0; i < hits.size(); i++) {
+ System.out.println(hits.get(i));
+ }
+ for (int j = hits.size() - 1; j >= 0; j--) {
+ // System.out.println(hits.get(j));
+ }
+ System.out.println("Time for search in ms: "
+ + (stop.getTime() - start.getTime()));
+
+ }
+
+ public static LinkedList<SingleBTS> getMR_greenhouse() {
+ LinkedList<SingleBTS> testlist = new LinkedList<SingleBTS>();
+ SingleBTS bts1 = new SingleBTS(880, -62, -77, false, new Date(),
+ "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, -63, -77, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, -67, -77, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, -69, -74, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+
+ SingleBTS bts2 = new SingleBTS(877, 0, -79, false, new Date(),
+ "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, 0, -82, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, 0, -82, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, 0, -82, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ return testlist;
+
+ }
+
+ public static LinkedList<SingleBTS> getMR_Mensa() {
+ LinkedList<SingleBTS> testlist = new LinkedList<SingleBTS>();
+ SingleBTS bts1 = new SingleBTS(880, 0, -80, false, new Date(),
+ "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -82, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -77, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -78, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+
+ SingleBTS bts2 = new SingleBTS(877, -66, -77, false, new Date(),
+ "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -69, -76, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -74, -77, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -76, -81, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ return testlist;
+
+ }
+
+ public static LinkedList<SingleBTS> getMR_Door51() {
+ LinkedList<SingleBTS> testlist = new LinkedList<SingleBTS>();
+ SingleBTS bts1 = new SingleBTS(880, 0, -107, false, new Date(),
+ "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -108, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -108, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+ bts1 = new SingleBTS(880, 0, -110, false, new Date(), "Tf. Geb. 78");
+ testlist.add(bts1);
+
+ SingleBTS bts2 = new SingleBTS(877, -47, -49, false, new Date(),
+ "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -47, -48, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -47, -48, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ bts2 = new SingleBTS(877, -47, -48, false, new Date(), "Tf. Geb. 101");
+ testlist.add(bts2);
+ return testlist;
+
+ }
+
+}