package helper; import DataStructure.GSMMap; import DataStructure.SingleBTS; /** * Fits GSM receive strength to youngs model at 1.8GHz * * @author richy * */ public class FunctionFit { final static double log1800 = (float) Math.log10(1800); /** * @param type * 0-2 for open, suburban, city. If type is not in range 0...2, * zero is returned * @return Hata Model Parameter K for 1800MHz (precomputed) */ @SuppressWarnings("unused") private static double C(int type) { // Parameter at the end of extendet Hata Model switch (type) { case 0: return 31.924; case 1: return 11.9386; default: return 0; } } /** * Returns value a(h) of the Hata Model. Use this when calculating DL * (Signal from BTS to MS) * * @param suburban * false, if surrounding is open or with medium buildings. True * if buildings > 15m exits * @param ms_height * height of mobile station antenna (typically around 1.6m) * @return value for a(h2), partly pre computed */ private static double a_DL(boolean suburban, double ms_height) { if (suburban) { return ((1.1 * log1800 - 0.7) * ms_height - (1.56 * log1800 - 0.8)); } else { return 3.2 * Math.pow(Math.log10(11.75 * ms_height), 2) - 4.97; } } /** * Returns value a(h) of the Hata Model. Use this when calculating UL * (Signal from MS to BTS) * * @param suburban * false, if surrounding is open or with medium buildings. True * if buildings > 15m exits * @param ms_height * height of mobile station antenna (typically around 1.6m) * @return value for a(h2), partly pre computed */ private static double a_UL(boolean suburban, double bts_height) { return a_DL(suburban, bts_height); } public static double do_fit(boolean DL, double receive1, double receive2, double receive3) { return 0.0; } public static boolean try_extrapolation(GSMMap map, SingleBTS arfcn, int x, int y) { if (ListBTS.contains(map.map[x][y], arfcn)) { // check if uplink can be extrapolated if (ListBTS.containsUL(map.map[x][y], arfcn)) { // nothing todo. map[x][y] contains DL and UL } else { // upload is missing. Try Interpolation here. BTS element // already exists } } else { // try Interpolation SingleBTS object does not exist } return false; } }