//OUTDATED: no longer used: 06.06.2011 package lookup; import helper.ListBTS; import helper.ListGPS; import java.util.ArrayList; import java.util.List; import DataStructure.GPScoordinate; import DataStructure.GSMMap; import DataStructure.SingleBTS; public class ResultScore { ArrayList scores = new ArrayList(); GSMMap map; /** * Gets score for every Coordinate * * @param list */ public ResultScore(GSMMap map) { this.map = map; } public ArrayList find(List MR, double thresholdDBm) { // looks like threshold_dB has to be as high as 25dBm ArrayList places = map.find(MR, thresholdDBm); GPScoordinate[] content = ListGPS.content(places); for (GPScoordinate curr_content : content) { // take every Coordinate once. Build a ScoreElement with it.Traverse // all found places ScoreElement curr_score = new ScoreElement(curr_content); for (GPScoordinate curr_place : places) { // count how often this place got marked curr_score.inc_occurence(curr_place); } scores.add(curr_score); // traverse every coordinate from gsm.find. check every tile if all // mesurements match. if not, score gets low // then, check BTS relations! } // check scores. compare it with map // HACK: hardcoded ratio between 877 and 880 for (int i = 0; i < scores.size(); i++) { ScoreElement score_at_i = scores.get(i); scores.set(i, ratioboost(score_at_i, MR)); } return scores; } private ScoreElement ratioboost(ScoreElement place, List MR) { // MR are the measured values during a call // ArrayList list = map.getBTSList(place.gps); // compare list with MR. Ratio between 877 and 880 while (ListBTS.contains(MR, 880) && ListBTS.contains(MR, 877)) { SingleBTS r880 = ListBTS.removeARFCN(MR, 880); SingleBTS r877 = ListBTS.removeARFCN(MR, 877); if (r880.getDldB() > -46 || r877.getDldB() > -46) { continue; } double ratio_MR = r880.getDldB() - r877.getDldB(); // compare ratio with gsmmap. Get a number between 100 and 0 % // double ratioscore = 0; // zero means absolutly no match ArrayList maplist = map.getBTSList(place.gps); // check if map has both BTS at this place if (ListBTS.contains(maplist, 880) && ListBTS.contains(maplist, 877)) { double ratio_map = ListBTS.getARFCN(maplist, 880).getDldB() - ListBTS.getARFCN(maplist, 877).getDldB(); // calculate distance in % if (ratio_MR >= ratio_map) { place.occurrence += (ratio_map / ratio_MR * 100); } else if (ratio_MR < ratio_map) { place.occurrence += (ratio_MR / ratio_map * 100); } } } return place; } } class ratio { SingleBTS first; SingleBTS second; }