User Manual, Developers Guide and API Documentation

RegistryProxy.hpp

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 #ifndef LTE_TIMING_REGISTRYPROXY_HPP
00029 #define LTE_TIMING_REGISTRYPROXY_HPP
00030 
00031 #include <WNS/scheduler/SchedulingMap.hpp>
00032 #include <WNS/scheduler/RegistryProxyInterface.hpp>
00033 #include <WNS/scheduler/SchedulerTypes.hpp>
00034 #include <WNS/pyconfig/View.hpp>
00035 #include <WNS/logger/Logger.hpp>
00036 
00037 #include <DLL/StationManager.hpp>
00038 #include <DLL/services/control/Association.hpp>
00039 #include <WNS/service/dll/StationTypes.hpp>
00040 #include <WNS/service/phy/phymode/PhyModeInterface.hpp>
00041 #include <WNS/service/phy/phymode/PhyModeMapperInterface.hpp>
00042 
00043 #include <LTE/helper/HasModeName.hpp>
00044 #include <string>
00045 
00046 namespace wns { namespace scheduler { namespace harq { class HARQInterface;}}}
00047 namespace dll { class Layer2;}
00048 namespace dll { namespace services { namespace control { class Association; }}}
00049 namespace dll { namespace services { namespace management { class InterferenceCache; }}}
00050 namespace lte { namespace controlplane { namespace associationHandler { class AssociationHandler; }}}
00051 
00052 namespace lte { namespace controlplane { class RRHandlerBS; class RRHandlerUT; }}
00053 namespace lte { namespace controlplane { namespace flowmanagement { class FlowManager; }}}
00054 
00055 namespace lte { namespace timing {
00056 
00057         class TimingScheduler;
00058 
00063         class RegistryProxy :
00064             virtual public wns::scheduler::RegistryProxyInterface,
00065             public lte::helper::HasModeName,
00066             public dll::services::control::AssociationObserver
00067         {
00068         public:
00069             typedef std::map<wns::scheduler::UserID, wns::scheduler::ConnectionVector> UserIdToConnections;
00070             typedef wns::container::Registry<wns::scheduler::ConnectionID, wns::scheduler::UserID> CidToUserId;
00071 
00072             RegistryProxy(wns::ldk::fun::FUN* _fun, const wns::pyconfig::View& config);
00073             ~RegistryProxy();
00074 
00075             void
00076             setFUN(const wns::ldk::fun::FUN* _fun);
00077 
00078             // obsolete. We need more classifiers than one. RLC+MACg
00079             void setFriends(const wns::ldk::CommandTypeSpecifierInterface* _classifier);
00080 
00082             wns::scheduler::UserID
00083             getUserForCID(wns::scheduler::ConnectionID cid);
00084 
00086             wns::service::dll::UnicastAddress
00087             getPeerAddressForCID(wns::scheduler::ConnectionID cid);
00088 
00089             wns::scheduler::ConnectionVector
00090             getConnectionsForUser(const wns::scheduler::UserID user/*nextHop!*/);
00091 
00092             wns::scheduler::ConnectionID
00093             getCIDforPDU(const wns::ldk::CompoundPtr& compound);
00094 
00095             std::string
00096             getNameForUser(const wns::scheduler::UserID user);
00097 
00098             wns::service::phy::phymode::PhyModeMapperInterface*
00099             getPhyModeMapper() const;
00100 
00101             wns::service::phy::phymode::PhyModeInterfacePtr
00102             getBestPhyMode(const wns::Ratio&);
00103 
00105             wns::scheduler::UserID
00106             getMyUserID();
00107 
00108             wns::scheduler::ChannelQualityOnOneSubChannel
00109             estimateTxSINRAt(const wns::scheduler::UserID user, int slot = 0);
00110 
00111             wns::scheduler::ChannelQualityOnOneSubChannel
00112             estimateRxSINROf(const wns::scheduler::UserID user, int slot = 0);
00113 
00114             wns::Power
00115             estimateInterferenceStdDeviation(const wns::scheduler::UserID user);
00116 
00117             wns::scheduler::Bits
00118             getQueueSizeLimitPerConnection();
00119 
00121             wns::service::dll::StationType
00122 
00123             getStationType(const wns::scheduler::UserID user);
00124 
00126             wns::scheduler::UserSet
00127             filterReachable(wns::scheduler::UserSet users);
00128 
00130             wns::scheduler::UserSet
00131             filterReachable(wns::scheduler::UserSet users, const int frameNr);
00132 
00134             //wns::scheduler::ConnectionSet
00135             //filterReachable(wns::scheduler::ConnectionSet connections);
00136 
00138             wns::scheduler::ConnectionSet
00139             filterReachable(wns::scheduler::ConnectionSet connections, const int frameNr, bool useHARQ);
00140 
00141 
00145             virtual wns::scheduler::PowerMap
00146             calcULResources(const wns::scheduler::UserSet&, unsigned long int) const;
00147 
00148             virtual wns::scheduler::UserSet
00149             getActiveULUsers() const;
00150 
00152             virtual int
00153             getTotalNumberOfUsers(const wns::scheduler::UserID user);
00154 
00156             virtual int
00157             getTotalNumberOfFlows() const;
00158 
00160             virtual int
00161             getNumberOfFlowsForUser(const wns::scheduler::UserID user) const;
00162 
00163             void setRelaysOnly();
00164             void setAllStations();
00165 
00168             wns::scheduler::ChannelQualitiesOnAllSubBandsPtr
00169             getChannelQualities4UserOnUplink(wns::scheduler::UserID user, int frameNr);
00170             wns::scheduler::ChannelQualitiesOnAllSubBandsPtr
00171             getChannelQualities4UserOnDownlink(wns::scheduler::UserID user, int frameNr);
00172 
00174             virtual wns::scheduler::PowerCapabilities
00175             getPowerCapabilities(const wns::scheduler::UserID user) const;
00176 
00178             virtual wns::scheduler::PowerCapabilities
00179             getPowerCapabilities() const;
00180 
00181             void
00182             setFrameNumberToBeScheduled(int frameNr);
00183 
00184             int
00185             getFrameNumberToBeScheduled() const { return frameNumberToBeScheduled; }
00186 
00187             bool
00188             hasResourcesGranted() const;
00189 
00191             void
00192             setDL(bool _isForDL);
00193 
00195             bool
00196             getDL() const;
00197 
00198             bool
00199             getCQIAvailable() const;
00200 
00201             void
00202             setAssociationHandler(lte::controlplane::associationHandler::AssociationHandler* ah);
00203 
00204             void
00205             setHARQ(wns::scheduler::harq::HARQInterface* harq);
00206 
00207             bool
00208             duplexGroupIsReachableAt(const wns::scheduler::UserID user, const int frameNr) const;
00209 
00211             int
00212             getNumberOfQoSClasses();
00214             virtual int
00215             getNumberOfPriorities();
00216 
00218             virtual wns::scheduler::ConnectionList&
00219             getCIDListForPriority(int priority);
00220 
00221             virtual wns::scheduler::ConnectionSet
00222             getConnectionsForPriority(int priority);
00223 
00226             virtual dll::NodeList
00227             getNodeList();
00228 
00229             int
00230             virtual getPriorityForConnection(wns::scheduler::ConnectionID cid);
00231 
00233             void
00234             deregisterCID(wns::scheduler::ConnectionID cid, wns::scheduler::UserID user/*nextHop!*/);
00235         private:
00237             bool
00238             isReachableAt(const wns::scheduler::UserID user, const int frameNr, bool useHARQ) const;
00239 
00241             void
00242             registerCID(wns::scheduler::ConnectionID cid, wns::scheduler::UserID user/*nextHop!*/);
00243 
00245             void
00246             deregisterUser(const wns::scheduler::UserID user/*nextHop!*/);
00247 
00249             void
00250             onAssociated(wns::service::dll::UnicastAddress userAdr, wns::service::dll::UnicastAddress dstAdr);
00251             void
00252             onDisassociated(wns::service::dll::UnicastAddress userAdr, wns::service::dll::UnicastAddress dstAdr);
00253 
00255             int
00256             mapQoSClassToPriority(wns::service::qos::QoSClass qosClass);
00257 
00259             wns::ldk::fun::FUN* fun;
00261             dll::Layer2* layer2;
00262             //dll::StationManager* stationManager;
00264             wns::logger::Logger logger;
00265 
00267             dll::services::control::Association* associationService;
00268 
00270             dll::services::management::InterferenceCache* iCache;
00271 
00273             struct Friends {
00274                 Friends() {rlcCommandReader=NULL;macgCommandReader=NULL;harq=NULL;timer=NULL;associationHandler=NULL;rrHandler=NULL; rrHandlerUT=NULL; flowManager=NULL;};
00275                 wns::ldk::CommandReaderInterface* rlcCommandReader;
00276                 wns::ldk::CommandReaderInterface* macgCommandReader;
00277                 wns::scheduler::harq::HARQInterface* harq;
00278                 lte::timing::TimingScheduler* timer;
00279                 lte::controlplane::associationHandler::AssociationHandler* associationHandler;
00280                 lte::controlplane::RRHandlerBS* rrHandler;
00281                 lte::controlplane::RRHandlerUT* rrHandlerUT;
00282                 lte::controlplane::flowmanagement::FlowManager* flowManager;
00283             } friends;
00284 
00287             wns::service::phy::phymode::PhyModeMapperInterface* phyModeMapper;
00288 
00289             wns::scheduler::ChannelQualitiesOnAllSubBandsPtr fakeChannelQualities;
00290 
00291             uint32_t queueSize;
00292 
00293             bool relaysOnly;
00294 
00295             wns::scheduler::PowerCapabilities powerUT;
00296             wns::scheduler::PowerCapabilities powerBS;
00297 
00298             bool eirpLimited;
00299 
00300             std::string apcstrategyName;
00301             std::string dsastrategyName;
00302             std::string dsafbstrategyName;
00303 
00305             int frameNumberToBeScheduled;
00306             simTimeType frameNumberToBeScheduled_setTime; // for asserts
00308             bool isForDL;
00310             wns::scheduler::TaskBSorUTType myTask;
00311 
00312             int numberOfPriorities;
00313             int numberOfQosClasses;
00314             std::vector<int> qosToPriorityMapping;
00315 
00316             CidToUserId cidToUserId; // RN|UT
00317             wns::container::Registry<wns::scheduler::ConnectionID, int> cidToPrio; // New[rs]
00318 
00320             UserIdToConnections userIdToConnections;
00321 
00323             std::vector<wns::scheduler::ConnectionList> connectionsForPriority;
00324         };
00325 
00326     }
00327 } // namespace lte::timing
00328 #endif // LTE_TIMING_REGISTRYPROXYLTE_HPP

Generated on Fri May 25 03:32:06 2012 for openWNS by  doxygen 1.5.5