![]() |
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_STRATEGY_STRATEGYINTERFACE_HPP 00029 #define WNS_SCHEDULER_STRATEGY_STRATEGYINTERFACE_HPP 00030 00031 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00032 #include <WNS/service/phy/ofdma/DataTransmission.hpp> 00033 #include <WNS/scheduler/strategy/apcstrategy/APCStrategyInterface.hpp> 00034 #include <WNS/scheduler/strategy/dsastrategy/DSAStrategyInterface.hpp> 00035 //#include <WNS/scheduler/MapInfoProviderInterface.hpp> 00036 #include <WNS/scheduler/CallBackInterface.hpp> 00037 #include <WNS/scheduler/SchedulingMap.hpp> 00038 #include <WNS/scheduler/SchedulerTypes.hpp> 00039 #include <WNS/StaticFactory.hpp> 00040 #include <WNS/PyConfigViewCreator.hpp> 00041 #include <WNS/SmartPtr.hpp> 00042 00043 namespace wns { namespace scheduler { 00044 namespace queue { 00045 class QueueInterface; 00046 } 00047 namespace harq { 00048 class HARQInterface; 00049 } 00050 namespace grouper { 00051 class GroupingProviderInterface; 00052 } 00053 namespace strategy { namespace tests { 00054 class StrategyTest; // friend 00055 }} 00056 00057 class RegistryProxyInterface; 00058 class CallBackInterface; 00059 }} // forward declarations 00060 00061 namespace wns { namespace scheduler { namespace strategy { 00065 class StrategyInput // NEW [rs] 00066 { 00067 public: 00069 StrategyInput(int _fChannels, 00070 double _slotLength, 00071 int _numberOfTimeSlots, 00072 int _maxSpatialLayers, 00073 CallBackInterface* _callBackObject); 00074 00076 StrategyInput(MapInfoEntryPtr _mapInfoEntryFromMaster, 00077 CallBackInterface* _callBackObject); 00078 00080 StrategyInput(int _fChannels, 00081 double _slotLength, 00082 int _numberOfTimeSlots, 00083 int _maxSpatialLayers, 00084 MapInfoEntryPtr _mapInfoEntryFromMaster, 00085 CallBackInterface* _callBackObject); 00086 00087 StrategyInput(); 00088 00089 ~StrategyInput(); 00090 00092 virtual void 00093 setFrameNr(int _frameNr); 00094 00095 virtual int 00096 getFrameNr() const { return frameNr; }; 00097 00098 virtual int 00099 getFChannels() const { return fChannels; }; 00100 00101 virtual double 00102 getSlotLength() const { return slotLength; }; 00103 00104 virtual int 00105 getNumberOfTimeSlots() const { return numberOfTimeSlots; }; 00106 00107 virtual int 00108 getMaxSpatialLayers() const { return maxSpatialLayers; }; 00109 00110 virtual bool 00111 frameNrIsValid() const; 00112 00116 virtual void 00117 setDefaultPhyMode(wns::service::phy::phymode::PhyModeInterfacePtr _phyModePtr); 00118 00122 virtual void 00123 setDefaultTxPower(wns::Power _txPower); 00124 00126 virtual 00127 wns::scheduler::SchedulingMapPtr getEmptySchedulingMap() const; 00128 00130 virtual 00131 wns::scheduler::SchedulingMapPtr getInputSchedulingMap() const; 00132 00135 virtual void 00136 setInputSchedulingMap(wns::scheduler::SchedulingMapPtr _inputSchedulingMap); 00137 00138 virtual std::string toString() const; 00139 public: 00141 int fChannels; 00142 00144 double slotLength; 00145 00147 int numberOfTimeSlots; 00148 00150 int numberOfAntennas; 00151 00154 bool beamforming; 00155 00159 int maxSpatialLayers; 00160 00163 CallBackInterface* callBackObject; 00164 00169 MapInfoEntryPtr mapInfoEntryFromMaster; 00170 00177 wns::scheduler::SchedulingMapPtr inputSchedulingMap; 00178 00180 wns::service::phy::phymode::PhyModeInterfacePtr defaultPhyModePtr; 00181 00183 wns::Power defaultTxPower; 00184 00186 int frameNr; 00187 }; // class StrategyInput 00188 00191 class StrategyResult // NEW [rs] 00192 : virtual public wns::RefCountable 00193 { 00194 public: 00196 StrategyResult(wns::scheduler::SchedulingMapPtr _schedulingMap, 00197 wns::scheduler::MapInfoCollectionPtr _bursts); 00198 00200 StrategyResult(wns::scheduler::SchedulingMapPtr _schedulingMap, 00201 wns::scheduler::MapInfoCollectionPtr _bursts, 00202 wns::scheduler::GroupingPtr _sdmaGrouping); 00203 00204 virtual 00205 ~StrategyResult(); 00206 00207 virtual std::string 00208 toString() const; 00209 00211 virtual float 00212 getResourceUsage() const; 00213 00215 virtual int 00216 getNumberOfCompoundsInBursts() const; 00217 00219 virtual void 00220 deleteCompoundsInBursts(); 00221 public: 00223 wns::scheduler::SchedulingMapPtr schedulingMap; 00224 00226 MapInfoCollectionPtr bursts; // historic name 00227 00231 //wns::scheduler::AntennaPatternsPerUser antennaPatterns; 00232 wns::scheduler::GroupingPtr sdmaGrouping; 00233 }; // class StrategyResult 00234 00236 typedef SmartPtr<StrategyResult> StrategyResultPtr; 00237 00239 typedef std::vector< StrategyResultPtr > StrategyResultHistory; 00240 00245 class StrategyInterface 00246 { 00247 public: 00248 virtual ~StrategyInterface() {}; 00249 00254 virtual MapInfoCollectionPtr getMapInfo() const = 0; 00255 00259 virtual void 00260 setColleagues(queue::QueueInterface* _queue, 00261 grouper::GroupingProviderInterface* _grouper, 00262 RegistryProxyInterface* _registry, 00263 wns::scheduler::harq::HARQInterface* _harq) = 0; 00264 00267 virtual void 00268 onColleaguesKnown() = 0; 00269 00272 virtual void 00273 setFriends(wns::service::phy::ofdma::BFInterface* ) = 0; 00274 00280 virtual StrategyResult 00281 startScheduling(const StrategyInput& StrategyInput) = 0; 00282 00285 virtual wns::scheduler::SchedulerSpotType 00286 getSchedulerSpotType() const = 0; 00287 00290 virtual bool 00291 isTx() const = 0; 00292 00293 00295 virtual bool 00296 isNewStrategy() const = 0; 00297 00299 virtual wns::scheduler::PowerCapabilities 00300 getPowerCapabilities(const UserID user) const = 0; 00301 00304 virtual float 00305 getResourceUsage() const = 0; 00306 00307 protected: 00311 virtual StrategyResult 00312 doStartScheduling(SchedulerStatePtr schedulerState, 00313 SchedulingMapPtr schedulingMap) = 0; 00314 00317 virtual SchedulerStatePtr 00318 getNewSchedulerState() = 0; 00319 00322 virtual SchedulerStatePtr 00323 revolveSchedulerState(const StrategyInput& strategyInput) = 0; 00324 00327 virtual SchedulerStatePtr 00328 getSchedulerState() = 0; 00329 00330 private: 00331 friend class wns::scheduler::strategy::tests::StrategyTest; 00332 }; 00333 00334 typedef wns::PyConfigViewCreator<StrategyInterface, StrategyInterface> StrategyCreator; 00335 typedef wns::StaticFactory<StrategyCreator> StrategyFactory; 00336 00337 }}} // namespace wns::scheduler::strategy 00338 #endif // WNS_SCHEDULER_STRATEGY_STRATEGYINTERFACE_HPP 00339 00340
1.5.5