User Manual, Developers Guide and API Documentation

Strategy.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-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_STRATEGY_STRATEGY_HPP
00029 #define WNS_SCHEDULER_STRATEGY_STRATEGY_HPP
00030 
00031 #include <WNS/scheduler/strategy/StrategyInterface.hpp>
00032 #include <WNS/scheduler/strategy/SchedulerState.hpp>
00033 #include <WNS/scheduler/SchedulerTypes.hpp>
00034 #include <WNS/scheduler/queue/QueueInterface.hpp>
00035 #include <WNS/scheduler/grouper/SpatialGrouper.hpp>
00036 #include <WNS/scheduler/strategy/apcstrategy/APCStrategyInterface.hpp>
00037 #include <WNS/scheduler/strategy/dsastrategy/DSAStrategyInterface.hpp>
00038 #include <WNS/service/phy/phymode/PhyModeInterface.hpp>
00039 #include <WNS/logger/Logger.hpp>
00040 
00041 namespace wns { namespace scheduler { namespace harq { class HARQInterface; }}}
00042 
00043 namespace wns { namespace scheduler { namespace strategy {
00044 
00045             const simTimeType slotLengthRoundingTolerance = 1e-12;
00046 
00047             class CapabilityAspect
00048             {
00049             public:
00050                 virtual ~CapabilityAspect(){};
00051                 virtual bool canHandleDL() { return false; };
00052                 virtual bool canHandleUL() { return false; };
00053                 virtual bool canBeSlave()  { return false; };
00054             };
00055 
00057             class DLAspect
00058                     : virtual public CapabilityAspect
00059             {
00060             public:
00061                 DLAspect(){};
00062                 virtual ~DLAspect(){};
00063                 virtual bool canHandleDL() { return true; };
00064             };
00065 
00067             class ULAspect
00068                     : virtual public CapabilityAspect
00069             {
00070             public:
00071                 ULAspect(){};
00072                 virtual ~ULAspect(){};
00073                 virtual bool canHandleUL() { return true; };
00074             };
00075 
00077             class SlaveAspect
00078                     : virtual public CapabilityAspect
00079             {
00080             public:
00081                 SlaveAspect(){};
00082                 virtual ~SlaveAspect(){};
00083                 virtual bool canBeSlave()  { return true; };
00084             };
00085 
00089             class Strategy
00090                     : virtual public StrategyInterface,
00091                       virtual public CapabilityAspect
00092             {
00093             public:
00094                 Strategy(const wns::pyconfig::View& config);
00096                 virtual ~Strategy();
00098                 virtual void setColleagues(queue::QueueInterface* _queue,
00099                                            grouper::GroupingProviderInterface* _grouper,
00100                                            RegistryProxyInterface* _registry,
00101                                            wns::scheduler::harq::HARQInterface* _harq
00102                     );
00103 
00106                 virtual void onColleaguesKnown();
00107 
00108                 virtual void setFriends(wns::service::phy::ofdma::BFInterface* _ofdmaProvider);
00109 
00111                 wns::scheduler::PowerCapabilities
00112                 getPowerCapabilities(const UserID user) const;
00113 
00116                 virtual float getResourceUsage() const;
00117 
00119                 virtual MapInfoEntryPtr
00120                 doAdaptiveResourceScheduling(wns::scheduler::strategy::RequestForResource& request,
00121                                              //wns::scheduler::SchedulerStatePtr schedulerState,
00122                                              wns::scheduler::SchedulingMapPtr schedulingMap);
00123 
00125                 virtual wns::scheduler::SchedulerSpotType
00126                 getSchedulerSpotType() const;
00127 
00130                 virtual bool isTx() const;
00131 
00133                 virtual bool isNewStrategy() const { return false; }
00134 
00138                 MapInfoCollectionPtr getMapInfo() const;
00139 
00140                 virtual dsastrategy::DSAStrategyInterface*
00141                 getDSAStrategy(){return colleagues.dsafbstrategy;};
00142 
00143             protected:
00144 
00146                 virtual SchedulerStatePtr
00147                 getNewSchedulerState();
00149                 virtual SchedulerStatePtr
00150                 revolveSchedulerState(const StrategyInput& strategyInput);
00152                 virtual SchedulerStatePtr
00153                 getSchedulerState();
00154 
00160                 virtual StrategyResult
00161                 startScheduling(const StrategyInput& StrategyInput);
00162 
00165                 virtual wns::service::phy::phymode::PhyModeInterfacePtr
00166                 getBestPhyMode(const wns::Ratio& sinr) const;
00167 
00168                 virtual bool groupingRequired() const;
00169 
00170                 struct Colleagues {
00171                     Colleagues() {queue=NULL;grouper=NULL;registry=NULL;dsastrategy=NULL;dsafbstrategy=NULL;apcstrategy=NULL;harq=NULL;};
00172                     queue::QueueInterface* queue;
00173                     grouper::GroupingProviderInterface* grouper;
00174                     RegistryProxyInterface* registry;
00175                     wns::scheduler::harq::HARQInterface* harq;
00176                     dsastrategy::DSAStrategyInterface* dsastrategy;
00177                     dsastrategy::DSAStrategyInterface* dsafbstrategy;
00178                     apcstrategy::APCStrategyInterface* apcstrategy;
00179                 } colleagues;
00180 
00181                 struct Friends {
00182                     Friends() {ofdmaProvider=NULL;};
00183                     wns::service::phy::ofdma::BFInterface* ofdmaProvider;
00184                 } friends;
00185 
00187                 wns::pyconfig::View pyConfig;
00189                 wns::logger::Logger logger;
00190 
00191             protected:
00194                 wns::Power getTxPower() const;
00195 
00196             private:
00197                 SchedulerStatePtr schedulerState;
00198             }; // class Strategy
00199         }}} // namespace wns::scheduler::strategy
00200 #endif // WNS_SCHEDULER_STRATEGY_STRATEGY_HPP
00201 
00202 

Generated on Sun May 27 03:31:54 2012 for openWNS by  doxygen 1.5.5