![]() |
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-2009 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 WNS_SCHEDULER_GROUPER_SPATIALGROUPER_HPP 00029 #define WNS_SCHEDULER_GROUPER_SPATIALGROUPER_HPP 00030 00031 #include <WNS/scheduler/SchedulerTypes.hpp> 00032 #include <WNS/scheduler/RegistryProxyInterface.hpp> 00033 #include <WNS/StaticFactory.hpp> 00034 #include <WNS/PyConfigViewCreator.hpp> 00035 #include <WNS/service/phy/ofdma/Pattern.hpp> 00036 #include <WNS/service/phy/ofdma/DataTransmission.hpp> 00037 #include <WNS/probe/bus/ContextCollector.hpp> 00038 #include <WNS/node/Interface.hpp> 00039 00040 namespace wns { namespace scheduler { namespace grouper { 00041 00044 00045 class GroupingProviderInterface { 00046 public: 00047 virtual ~GroupingProviderInterface() {}; 00048 virtual Grouping getTxGrouping(UserSet activeUsers, int maxBeams) = 0; 00049 virtual Grouping getRxGrouping(UserSet activeUsers, int maxBeams) = 0; 00050 virtual wns::scheduler::GroupingPtr getTxGroupingPtr(UserSet activeUsers, int maxBeams); 00051 virtual wns::scheduler::GroupingPtr getRxGroupingPtr(UserSet activeUsers, int maxBeams); 00052 00053 virtual void setColleagues(RegistryProxyInterface* registry) = 0; 00054 virtual void setFriends(wns::service::phy::ofdma::BFInterface*) = 0; 00055 }; 00056 00059 class SpatialGrouper 00060 : public GroupingProviderInterface { 00061 public: 00062 00063 SpatialGrouper(const wns::pyconfig::View& config); 00064 virtual ~SpatialGrouper(){} 00065 00066 virtual void setColleagues(RegistryProxyInterface* _registry); 00067 virtual void setFriends(wns::service::phy::ofdma::BFInterface* _ofdmaProvider); 00068 00069 protected: 00070 template<typename T> 00071 std::map<UserID, T> 00072 convertMap(std::map<wns::node::Interface*, T> r) 00073 { 00074 typename std::map<wns::node::Interface*, T>::iterator it; 00075 typename std::map<UserID, T> converted; 00076 for (it=r.begin(); it!=r.end();++it) 00077 { 00078 converted.insert(std::pair<UserID, T>(UserID(it->first), it->second) ); 00079 } 00080 return converted; 00081 } 00082 00083 int setupProbe(float minX, float maxX, std::string name, int bins); 00084 00085 struct { 00086 RegistryProxyInterface* registry; 00087 const wns::service::phy::phymode::PhyModeMapperInterface* phyModeMapper; 00088 } colleagues; 00089 00090 struct { 00091 wns::service::phy::ofdma::BFInterface* ofdmaProvider; 00092 } friends; 00093 00094 wns::Power x_friendliness; 00095 wns::Power txPower; 00096 bool eirpLimited; 00097 bool MonteCarloSim; 00098 bool beamforming; 00099 bool uplink; 00100 00101 wns::probe::bus::ContextCollectorPtr groupingGainProbeBus; 00102 00103 wns::logger::Logger logger; 00104 }; 00105 00106 // StaticFactory typedefs to allow creation of Groupers adhering to the GroupingProviderInterface 00107 typedef wns::PyConfigViewCreator<GroupingProviderInterface, GroupingProviderInterface> SpatialGrouperCreator; 00108 typedef wns::StaticFactory<SpatialGrouperCreator> SpatialGrouperFactory; 00109 00110 }}} // namespace wns::scheduler 00111 #endif // WNS_SCHEDULER_GROUPER_SPATIALGROUPER_HPP 00112 00113
1.5.5