![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #include <RISE/scenario/pathloss/ITURMa.hpp> 00029 00030 #include <WNS/StaticFactoryBroker.hpp> 00031 00032 STATIC_FACTORY_BROKER_REGISTER(rise::scenario::pathloss::ITURMa, rise::scenario::pathloss::Pathloss, "ITURMa"); 00033 00034 using namespace rise::scenario::pathloss; 00035 00036 ITURMa::ITURMa(const wns::pyconfig::View& pyco): 00037 ITUPathloss(pyco) 00038 { 00039 streetWidth_ = pyco.get<double>("streetWidth"); 00040 buildingHeight_ = pyco.get<double>("buildingHeight"); 00041 } 00042 00043 double 00044 ITURMa::getLOSProbability(double distance) const 00045 { 00046 if (distance <= 10.0) 00047 { 00048 return 1.0; 00049 } 00050 00051 double pLOS = exp(- (distance-10.0)/1000.0); 00052 return pLOS; 00053 } 00054 00055 wns::Ratio 00056 ITURMa::getLOSPathloss(const rise::antenna::Antenna& source, 00057 const rise::antenna::Antenna& target, 00058 const wns::Frequency& frequency, 00059 const wns::Distance& distance) const 00060 { 00061 double bsHeight = source.getPosition().getZ(); 00062 double utHeight = target.getPosition().getZ(); 00063 00064 // We must assume here that the higher one is the BS 00065 if (bsHeight < utHeight) std::swap(bsHeight, utHeight); 00066 00067 assure(bsHeight > 10.0, "BS Height must be at least 10 m"); 00068 assure(bsHeight < 150.0, "BS Height cannot be larger than 150 m"); 00069 assure(utHeight > 1.0, "BS Height must be at least 1 m"); 00070 assure(utHeight < 10.0, "BS Height cannot be larger than 10 m"); 00071 00072 double dBP = 2 * 3.14 * bsHeight * utHeight * frequency / 3.0e02; 00073 00074 if (distance < dBP) 00075 { 00076 double pl = 20.0 * log10(distance * 40 * 3.14 * frequency/3000.0); 00077 pl += std::min(0.03 * pow(buildingHeight_, 1.72), 10.0) * log10(distance); 00078 pl -= std::min(0.044 * pow(buildingHeight_, 1.72), 14.77); 00079 pl += 0.002*log10(buildingHeight_)*distance; 00080 00081 return wns::Ratio::from_dB(pl); 00082 } 00083 else 00084 { 00085 double pl = 20.0 * log10(dBP * 40 * 3.14 * frequency/3000.0); 00086 pl += std::min(0.03 * pow(buildingHeight_, 1.72), 10.0) * log10(dBP); 00087 pl -= std::min(0.044 * pow(buildingHeight_, 1.72), 14.77); 00088 pl += 0.002*log10(buildingHeight_)*dBP; 00089 00090 pl += 40 * log10(distance / dBP); 00091 return wns::Ratio::from_dB(pl); 00092 } 00093 } 00094 00095 wns::Ratio 00096 ITURMa::getNLOSPathloss(const rise::antenna::Antenna& source, 00097 const rise::antenna::Antenna& target, 00098 const wns::Frequency& frequency, 00099 const wns::Distance& distance) const 00100 { 00101 double bsHeight = source.getPosition().getZ(); 00102 double utHeight = target.getPosition().getZ(); 00103 00104 // We must assume here that the higher one is the BS 00105 if (bsHeight < utHeight) std::swap(bsHeight, utHeight); 00106 00107 assure(bsHeight > 10.0, "BS Height must be at least 10 m"); 00108 assure(bsHeight < 150.0, "BS Height cannot be larger than 150 m"); 00109 assure(utHeight > 1.0, "BS Height must be at least 1 m"); 00110 assure(utHeight < 10.0, "BS Height cannot be larger than 10 m"); 00111 00112 double pl = 161.04 - 7.1 * log10(streetWidth_) + 7.5 * log10(buildingHeight_); 00113 pl -= (24.37 - 3.7 * pow(buildingHeight_ / bsHeight, 2)) * log10(bsHeight); 00114 pl += (43.42 - 3.1 * log10(bsHeight) ) * (log10(distance) - 3.0); 00115 pl += 20.0 * log10(frequency/1000.0); 00116 pl -= 3.2 * pow(log10(11.75 * utHeight), 2) - 4.97; 00117 00118 return wns::Ratio::from_dB(pl); 00119 } 00120 00121 double 00122 ITURMa::getLOSShadowingStd(const rise::antenna::Antenna& source, 00123 const rise::antenna::Antenna& target, 00124 const wns::Frequency& frequency, 00125 const wns::Distance& distance) const 00126 { 00127 assure(distance > 10.0, "This model is only valid for a minimum distance of 10m"); 00128 assure(distance < 5000.0, "This model is only valid for a maximum distance of 5000m"); 00129 00130 double bsHeight = source.getPosition().getZ(); 00131 double utHeight = target.getPosition().getZ(); 00132 00133 // We must assume here that the higher one is the BS 00134 if (bsHeight < utHeight) std::swap(bsHeight, utHeight); 00135 00136 assure(bsHeight > 10.0, "BS Height must be at least 10 m"); 00137 assure(bsHeight < 150.0, "BS Height cannot be larger than 150 m"); 00138 assure(utHeight > 1.0, "BS Height must be at least 1 m"); 00139 assure(utHeight < 10.0, "BS Height cannot be larger than 10 m"); 00140 00141 double dBP = 2 * 3.14 * bsHeight * utHeight * frequency / 3.0e02; 00142 00143 if (distance < dBP) 00144 { 00145 return 4.0; 00146 } 00147 else 00148 { 00149 return 6.0; 00150 } 00151 } 00152 00153 double 00154 ITURMa::getNLOSShadowingStd(const rise::antenna::Antenna& source, 00155 const rise::antenna::Antenna& target, 00156 const wns::Frequency& frequency, 00157 const wns::Distance& distance) const 00158 { 00159 assure(distance > 10.0, "This model is only valid for a minimum distance of 10m"); 00160 assure(distance < 5000.0, "This model is only valid for a maximum distance of 5000m"); 00161 00162 return 8.0; 00163 } 00164 00165 double 00166 ITURMa::getCarPenetrationStd() const 00167 { 00168 return 5.0; 00169 } 00170 00171 double 00172 ITURMa::getCarPenetrationMean() const 00173 { 00174 return 9.0; 00175 }
1.5.5