User Manual, Developers Guide and API Documentation

SpatialGrouper.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-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 
00029 #include <WNS/scheduler/grouper/SpatialGrouper.hpp>
00030 #include <WNS/scheduler/SchedulerTypes.hpp>
00031 
00032 using namespace wns::scheduler::grouper;
00033 
00034 wns::scheduler::GroupingPtr
00035 GroupingProviderInterface::getTxGroupingPtr(UserSet activeUsers, int maxBeams)
00036 {
00037     return GroupingPtr(new Grouping(getTxGrouping(activeUsers,maxBeams)));
00038 }
00039 
00040 wns::scheduler::GroupingPtr
00041 GroupingProviderInterface::getRxGroupingPtr(UserSet activeUsers, int maxBeams)
00042 {
00043     return GroupingPtr(new Grouping(getRxGrouping(activeUsers,maxBeams)));
00044 }
00045 
00046 SpatialGrouper::SpatialGrouper(const wns::pyconfig::View& config)
00047     : x_friendliness(wns::Power::from_dBm(config.get<double>("friendliness_dBm"))),
00048       txPower(wns::Power::from_mW(0)), // to be initialised once the
00049       eirpLimited(false),              // ofdmaProvider is known
00050       MonteCarloSim(config.get<bool>("MonteCarloSim")),
00051       beamforming(config.get<bool>("beamforming")),
00052       uplink(config.get<bool>("uplink")),
00053       logger(config.get("logger"))
00054 {
00055     // initialize them to NULL, so assure can work
00056     colleagues.registry = NULL;
00057     friends.ofdmaProvider = NULL;
00058 }
00059 
00060 void
00061 SpatialGrouper::setColleagues(RegistryProxyInterface* _registry)
00062 {
00063     colleagues.registry = _registry;
00064     colleagues.phyModeMapper = colleagues.registry->getPhyModeMapper();
00065 
00066     if (!MonteCarloSim){
00067         if (!uplink){
00068             groupingGainProbeBus = wns::probe::bus::ContextCollectorPtr(
00069                 new wns::probe::bus::ContextCollector(
00070                     wns::probe::bus::ContextProviderCollection(
00071                         &colleagues.registry->getMyUserID().getContextProviderCollection()),
00072                     "groupingGain"));
00073         }
00074         else{
00075             groupingGainProbeBus = wns::probe::bus::ContextCollectorPtr(
00076                 new wns::probe::bus::ContextCollector(
00077                     wns::probe::bus::ContextProviderCollection(
00078                         &colleagues.registry->getMyUserID().getContextProviderCollection()),
00079                     "groupingGainUL"));
00080         }
00081     }
00082 }
00083 
00084 void
00085 SpatialGrouper::setFriends(wns::service::phy::ofdma::BFInterface* _ofdmaProvider)
00086 {
00087     friends.ofdmaProvider = _ofdmaProvider;
00088     txPower = friends.ofdmaProvider->getMaxPowerPerSubband();
00089     eirpLimited = friends.ofdmaProvider->isEIRPLimited();
00090 }
00091 

Generated on Fri May 25 03:31:52 2012 for openWNS by  doxygen 1.5.5