User Manual, Developers Guide and API Documentation

ITUUMa.cpp

Go to the documentation of this file.
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/ITUUMa.hpp>
00029 
00030 #include <WNS/StaticFactoryBroker.hpp>
00031 
00032 STATIC_FACTORY_BROKER_REGISTER(rise::scenario::pathloss::ITUUMa, rise::scenario::pathloss::Pathloss, "ITUUMa");
00033 
00034 using namespace rise::scenario::pathloss;
00035 
00036 ITUUMa::ITUUMa(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 ITUUMa::getLOSProbability(double distance) const
00045 {
00046     double pLOS = std::min(1.0, 18.0/distance) * (1 - exp(-distance/63.0)) + exp(-distance/63.0);
00047     return pLOS;
00048 }
00049 
00050 wns::Ratio
00051 ITUUMa::getLOSPathloss(const rise::antenna::Antenna& source,
00052                        const rise::antenna::Antenna& target,
00053                        const wns::Frequency& frequency,
00054                        const wns::Distance& distance) const
00055 {
00056     double bsHeight = source.getPosition().getZ();
00057     double utHeight = target.getPosition().getZ();
00058 
00059     // We must assume here that the higher one is the BS
00060     if (bsHeight < utHeight) std::swap(bsHeight, utHeight);
00061 
00062     assure(bsHeight > 10.0, "BS Height must be at least 10 m");
00063     assure(bsHeight < 150.0, "BS Height cannot be larger than 150 m");
00064     assure(utHeight > 1.0, "BS Height must be at least 1 m");
00065     assure(utHeight < 10.0, "BS Height cannot be larger than 10 m");
00066 
00067     // For UMaLOS the effictive heights are used heff = h - 1.0
00068     bsHeight -= 1.0;
00069     utHeight -= 1.0;
00070 
00071     double dBP = 4 * bsHeight * utHeight * frequency / 3.0e02;
00072 
00073     if (distance < dBP)
00074     {
00075         return wns::Ratio::from_dB(22.0 * log10(distance) + 28.0 + 20 * log10(frequency/1000.0));
00076     }
00077     else
00078     {
00079         double pl = 40 * log10(distance) + 7.8;
00080         pl -= 18.0 * log10(bsHeight) + 18.0 * log10(utHeight);
00081         pl += 2 * log10(frequency / 1000.0);
00082 
00083         return wns::Ratio::from_dB(pl);
00084     }
00085 }
00086 
00087 wns::Ratio
00088 ITUUMa::getNLOSPathloss(const rise::antenna::Antenna& source,
00089                         const rise::antenna::Antenna& target,
00090                         const wns::Frequency& frequency,
00091                         const wns::Distance& distance) const
00092 {
00093     double bsHeight = source.getPosition().getZ();
00094     double utHeight = target.getPosition().getZ();
00095 
00096     // We must assume here that the higher one is the BS
00097     if (bsHeight < utHeight) std::swap(bsHeight, utHeight);
00098 
00099     assure(bsHeight > 10.0, "BS Height must be at least 10 m");
00100     assure(bsHeight < 150.0, "BS Height cannot be larger than 150 m");
00101     assure(utHeight > 1.0, "BS Height must be at least 1 m");
00102     assure(utHeight < 10.0, "BS Height cannot be larger than 10 m");
00103 
00104     double pl = 161.04 - 7.1 * log10(streetWidth_) + 7.5 * log10(buildingHeight_);
00105     pl -= (24.37 - 3.7 * pow(buildingHeight_ / bsHeight, 2)) * log10(bsHeight);
00106     pl += (43.42 - 3.1 * log10(bsHeight) ) * (log10(distance) - 3.0);
00107     pl += 20.0 * log10(frequency/1000.0);
00108     pl -= 3.2 * pow(log10(11.75 * utHeight), 2) - 4.97;
00109 
00110     return wns::Ratio::from_dB(pl);
00111 }
00112 
00113 double
00114 ITUUMa::getLOSShadowingStd(const rise::antenna::Antenna& source,
00115                            const rise::antenna::Antenna& target,
00116                            const wns::Frequency& frequency,
00117                            const wns::Distance& distance) const
00118 {
00119     assure(distance > 10.0, "This model is only valid for a minimum distance of 10m");
00120     assure(distance < 5000.0, "This model is only valid for a maximum distance of 5000m");
00121 
00122     return 4.0;
00123 }
00124 
00125 double
00126 ITUUMa::getNLOSShadowingStd(const rise::antenna::Antenna& source,
00127                             const rise::antenna::Antenna& target,
00128                             const wns::Frequency& frequency,
00129                             const wns::Distance& distance) const
00130 {
00131     assure(distance > 10.0, "This model is only valid for a minimum distance of 10m");
00132     assure(distance < 5000.0, "This model is only valid for a maximum distance of 5000m");
00133 
00134     return 6.0;
00135 }
00136 
00137 double
00138 ITUUMa::getCarPenetrationStd() const
00139 {
00140     return 5.0;
00141 }
00142 
00143 double
00144 ITUUMa::getCarPenetrationMean() const
00145 {
00146     return 9.0;
00147 }

Generated on Thu May 24 03:31:56 2012 for openWNS by  doxygen 1.5.5