![]() |
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 #ifndef RISE_PLMAPPING_PHYMODEMAPPER_HPP 00029 #define RISE_PLMAPPING_PHYMODEMAPPER_HPP 00030 00031 #include <string> 00032 #include <vector> 00033 #include <WNS/PowerRatio.hpp> 00034 #include <WNS/Interval.hpp> 00035 #include <WNS/container/Registry.hpp> 00036 #include <WNS/container/RangeMap.hpp> 00037 #include <WNS/StaticFactory.hpp> 00038 #include <WNS/pyconfig/View.hpp> 00039 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00040 #include <WNS/service/phy/phymode/PhyModeMapperInterface.hpp> 00041 00042 #include <RISE/plmapping/PhyMode.hpp> 00043 #include <RISE/plmapping/CodeRates.hpp> 00044 #include <RISE/plmapping/MI2PER.hpp> 00045 #include <RISE/plmapping/SNR2MI.hpp> 00046 00047 //namespace wns { namespace service { namespace phy { namespace phymode { 00048 namespace rise { namespace plmapping { 00049 00054 class PhyModeMapper : 00055 public virtual wns::service::phy::phymode::PhyModeMapperInterface // in libwns 00056 { 00057 public: 00059 typedef wns::SmartPtr<PhyMode> PhyModePtr; 00060 typedef std::vector< PhyModePtr > PhyModeVector; 00061 00062 private: 00063 unsigned int subCarriersPerSubChannel; 00064 simTimeType symbolDuration; 00065 unsigned int phyModeCount; 00066 double minimumSINR; 00067 00069 PhyModeVector phyModeVector; 00070 00072 typedef wns::container::RangeMap<double, unsigned int> PhyModeRangeMap; 00073 00075 PhyModeRangeMap phyModeRangeMap; 00076 00079 typedef wns::container::Registry< PhyMode, wns::service::phy::phymode::SINRRange > PhyModeSINRRangeRegistry; 00080 00082 PhyModeSINRRangeRegistry phyModeSINRRangeRegistry; 00083 00085 wns::service::phy::phymode::MI2PERMappingInterface* mi2perMapper; 00086 wns::service::phy::phymode::SNR2MIInterface* SNR2MImapper; 00088 wns::logger::Logger logger; 00089 00090 public: 00091 // Constructor 00092 PhyModeMapper(const wns::pyconfig::View& config); 00093 00094 virtual ~PhyModeMapper() {} 00095 00097 virtual wns::service::phy::phymode::PhyModeInterfacePtr 00098 getBestPhyMode(const wns::Ratio& sinr) const; 00099 00101 //virtual wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> 00102 virtual wns::service::phy::phymode::PhyModeInterfacePtr 00103 getBestPhyMode(double sinr /* dB */) const; 00104 00106 int 00107 getBestPhyModeIndex(double sinr /* dB */) const; 00108 00110 virtual wns::Ratio 00111 getMinSINRRatio(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const; 00112 00114 virtual double 00115 getMinSINR(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const; 00116 00118 virtual wns::service::phy::phymode::SINRRange 00119 getSINRRange(const wns::service::phy::phymode::PhyModeInterfacePtr phyMode) const; 00120 00122 //virtual wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> 00123 virtual const wns::service::phy::phymode::PhyModeInterfacePtr 00124 getHighestPhyMode() const; 00125 00127 //virtual wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> 00128 virtual const wns::service::phy::phymode::PhyModeInterfacePtr 00129 getLowestPhyMode() const; 00130 00132 virtual int 00133 getPhyModeCount() const; 00134 00136 virtual PhyModeVector 00137 getListOfPhyModes() const; 00138 00140 virtual const std::vector< wns::service::phy::phymode::PhyModeInterfacePtr > 00141 getListOfPhyModePtr() const; 00142 00144 virtual wns::service::phy::phymode::PhyModeInterfacePtr 00145 getPhyModeForIndex(int index) const; 00146 00148 virtual int 00149 getIndexForPhyMode(const wns::service::phy::phymode::PhyModeInterface& phyMode) const; 00150 00152 virtual double getMinimumSINR() const { return minimumSINR; }; 00153 00155 virtual bool sinrIsAboveLimit(double sinr /* dB */) const { return (sinr>=minimumSINR); }; 00156 virtual bool sinrIsAboveLimit(const wns::Ratio& sinr) const { return (sinr.get_dB()>=minimumSINR); }; 00157 00165 virtual void 00166 calculateSINRRanges(double targetPER, unsigned int bl); 00167 00170 std::string 00171 printSwitchingPoints() const; 00172 00175 std::string 00176 printPhyModeNames() const; 00177 00178 protected: 00180 virtual void setMinimumSINR(double sinr) { minimumSINR=sinr; } 00182 //virtual const rise::plmapping::PhyModeSINRRangeRegistry& 00183 //getPhyModeSINRRangeRegistry() const; 00184 }; 00185 00186 }} 00187 //}}}} 00188 00189 #endif // RISE_PLMAPPING_PHYMODEMAPPER_HPP
1.5.5