def logNormalShadowing(self, intf): """Log-Normal Shadowing Propagation Loss Model distance is the range of the transmitter (m)""" from mn_wifi.wmediumdConnector import WmediumdGRandom, w_server, \ wmediumd_mode mean = 0 ref_d = 1 dist = intf.range gain = intf.antennaGain variance = ppm.variance gRandom = round(gauss(mean, variance), 2) ppm.gRandom = gRandom if wmediumd_mode == 3: sleep(0.001) # notice problem when there are many threads w_server.update_gaussian_random(WmediumdGRandom( intf.wmIface, gRandom)) pl = self.path_loss(intf, ref_d) - gRandom self.txpower = 10 * ppm.exp * math.log10(dist / ref_d) + \ ppm.noise_th + pl - (gain * 2) if self.txpower < 0: self.txpower = 1 return self.txpower
def logNormalShadowing(self, **kwargs): """Log-Normal Shadowing Propagation Loss Model distance is the range of the transmitter (m)""" from mn_wifi.wmediumdConnector import WmediumdGRandom, w_server mean = 0 d = kwargs['dist'] ref_d = 1 gain = kwargs['node'].params['antennaGain'][kwargs['wlan']] variance = propagationModel.variance gRandom = float('%.2f' % gauss(mean, variance)) propagationModel.gRandom = gRandom if kwargs['interference']: sleep(0.001) # notice problem when there are many threads w_server.update_gaussian_random( WmediumdGRandom(kwargs['node'].wmIface[kwargs['wlan']], gRandom)) pl = self.pathLoss(kwargs['node'], ref_d, kwargs['wlan']) - gRandom self.txpower = 10 * ppm.exp * math.log10(d / ref_d) + \ ppm.noise_threshold + pl - (gain * 2) if self.txpower < 0: self.txpower = 1 return self.txpower
def logNormalShadowing(self, intf): """Log-Normal Shadowing Propagation Loss Model""" from mn_wifi.wmediumdConnector import WmediumdGRandom, w_server, \ wmediumd_mode ref_d = 1 txpower = int(intf.txpower) gain = int(intf.antennaGain) gains = txpower + (gain * 2) mean = 0 variance = ppm.variance gRandom = round(gauss(mean, variance), 2) ppm.gRandom = gRandom if wmediumd_mode == 3: sleep(0.002) # noticed problem when there are multiple threads w_server.update_gaussian_random( WmediumdGRandom(intf.wmIface, gRandom)) pl = self.path_loss(intf, ref_d) - gRandom numerator = -ppm.noise_th - pl + gains denominator = 10 * ppm.exp self.range = math.pow(10, (numerator / denominator)) * ref_d return self.range
def logNormalShadowing(self, **kwargs): """Log-Normal Shadowing Propagation Loss Model""" from mn_wifi.wmediumdConnector import WmediumdGRandom, w_server ref_d = 1 txpower = kwargs['node'].params['txpower'][kwargs['wlan']] gain = kwargs['node'].params['antennaGain'][kwargs['wlan']] gains = txpower + (gain * 2) mean = 0 variance = propagationModel.variance gRandom = float('%.2f' % gauss(mean, variance)) propagationModel.gRandom = gRandom if kwargs['interference']: sleep(0.002) #notice problem when there are multiple threads w_server.update_gaussian_random( WmediumdGRandom(kwargs['node'].wmIface[kwargs['wlan']], gRandom)) pl = self.pathLoss(kwargs['node'], ref_d, kwargs['wlan']) - gRandom numerator = -ppm.noise_threshold - pl + gains denominator = 10 * ppm.exp self.dist = math.pow(10, (numerator / denominator)) * ref_d return self.dist