User Manual, Developers Guide and API Documentation

NoGrouper.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 #include <WNS/scheduler/grouper/NoGrouper.hpp>
00029 #include <WNS/scheduler/SchedulerTypes.hpp>
00030 
00031 using namespace wns::scheduler;
00032 using namespace wns::scheduler::grouper;
00033 
00034 STATIC_FACTORY_REGISTER_WITH_CREATOR(NoGrouper, GroupingProviderInterface, "NoGrouper", wns::PyConfigViewCreator);
00035 
00036 NoGrouper::NoGrouper(const wns::pyconfig::View&) :
00037     registry(NULL)
00038 {}
00039 
00040 NoGrouper::~NoGrouper()
00041 {}
00042 
00043 Grouping
00044 NoGrouper::getTxGrouping(const UserSet activeUsers, int)
00045 {
00046     Grouping grouping;
00047 
00048     int groupNumber = 0;
00049     for (UserSet::iterator iter = activeUsers.begin();
00050          iter != activeUsers.end();
00051          ++iter) {
00052         
00053         assure(iter->isValid(), "No valid user");
00054         wns::scheduler::ChannelQualityOnOneSubChannel cqi = 
00055             registry->estimateTxSINRAt(*iter);
00056         wns::CandI sinrEstimation(cqi.carrier, cqi.interference); 
00057         Group group;
00058         group[*iter] = sinrEstimation;
00059 
00060         grouping.patterns[*iter] = wns::service::phy::ofdma::PatternPtr();
00061         grouping.groups.push_back(group);
00062         grouping.userGroupNumber[*iter] = groupNumber++;
00063     }
00064     return grouping;
00065 }
00066 
00067 Grouping
00068 NoGrouper::getRxGrouping(const UserSet activeUsers, int)
00069 {
00070     Grouping grouping;
00071 
00072     int groupNumber = 0;
00073     for (UserSet::iterator iter = activeUsers.begin();
00074          iter != activeUsers.end();
00075          ++iter) {
00076 
00077         assure(iter->isValid(), "No valid user");
00078         wns::scheduler::ChannelQualityOnOneSubChannel cqi = 
00079             registry->estimateRxSINROf(*iter);
00080         wns::CandI sinrEstimation(cqi.carrier, cqi.interference); 
00081         Group group;
00082         group[*iter] = sinrEstimation;
00083 
00084         grouping.patterns[*iter] = wns::service::phy::ofdma::PatternPtr();
00085         grouping.groups.push_back(group);
00086         grouping.userGroupNumber[*iter] = groupNumber++;
00087     }
00088     return grouping;
00089 }
00090 
00091 void
00092 NoGrouper::setColleagues(RegistryProxyInterface* _registry)
00093 {
00094     registry = _registry;
00095 }
00096 
00097 

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