![]() |
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-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_CONTROLPLANE_MAPHANDLER_HPP 00029 #define LTE_CONTROLPLANE_MAPHANDLER_HPP 00030 00031 #include <LTE/controlplane/MapHandlerInterface.hpp> 00032 #include <LTE/timing/partitioning/PartitioningInfo.hpp> 00033 #include <LTE/helper/HasModeName.hpp> 00034 00035 #include <DLL/services/control/Association.hpp> 00036 00037 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00038 #include <WNS/ldk/HasReceptor.hpp> 00039 #include <WNS/ldk/HasConnector.hpp> 00040 #include <WNS/ldk/HasDeliverer.hpp> 00041 #include <WNS/ldk/Compound.hpp> 00042 #include <WNS/ldk/Command.hpp> 00043 #include <WNS/scheduler/MapInfoProviderInterface.hpp> 00044 #include <WNS/scheduler/MapInfoEntry.hpp> 00045 #include <WNS/scheduler/SchedulingMap.hpp> 00046 #include <WNS/scheduler/SchedulerTypes.hpp> 00047 #include <WNS/Subject.hpp> 00048 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00049 #include <WNS/pyconfig/View.hpp> 00050 00051 namespace wns { namespace node { class Node; }} 00052 00053 namespace lte { 00054 namespace timing { 00055 class TimingScheduler; 00056 class SchedulerIncoming; 00057 } 00058 namespace macr { 00059 class PhyUser; 00060 } 00061 namespace controlplane { 00062 00063 typedef std::vector<wns::scheduler::MapInfoCollectionPtr> MapInfoCollectionVector; 00064 typedef std::vector<wns::scheduler::SchedulingMapPtr> SchedulingMapCollectionVector; 00065 00067 class MapCommand 00068 : public wns::ldk::Command 00069 { 00070 public: 00071 MapCommand() 00072 { 00073 }; 00074 struct Local { 00075 } local; 00080 struct Friends { 00081 std::vector<int> ulFrameNumbers; 00082 std::vector<int> dlFrameNumbers; 00083 00084 SchedulingMapCollectionVector dlSchedulingMapVector; 00085 SchedulingMapCollectionVector ulSchedulingMapVector; 00086 } peer; 00087 struct Magic { 00088 wns::service::dll::UnicastAddress source; 00089 } magic; 00090 }; 00091 00095 class MapHandler : 00096 public virtual wns::ldk::FunctionalUnit, 00097 public wns::ldk::CommandTypeSpecifier<MapCommand>, 00098 public wns::ldk::HasReceptor<>, 00099 public wns::ldk::HasConnector<>, 00100 public wns::ldk::HasDeliverer<>, 00101 public wns::Cloneable<MapHandler>, 00102 public lte::helper::HasModeName, 00103 public wns::Subject<ResourceGrantNotificationInterface>, 00104 public IMapHandlerTiming, 00105 public IMapHandlerRS 00106 { 00107 public: 00108 00109 MapHandler(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00110 virtual ~MapHandler(); 00111 virtual void onFUNCreated(); 00112 00114 virtual void doSendData(const wns::ldk::CompoundPtr& /* compound */); 00115 virtual void doOnData(const wns::ldk::CompoundPtr& /* compound */); 00116 00118 virtual wns::scheduler::SchedulingMapPtr 00119 getMasterMapForSlaveScheduling(int frameNr); 00120 00122 virtual void calculateSizes(const wns::ldk::CommandPool* commandPool, Bit& _pciSize, Bit& _pduSize) const; 00123 00125 void startMapTx(simTimeType duration, std::vector<int> dlFrameNumbers, std::vector<int> ulFrameNumbers); 00127 void startMapRx(); 00129 void prepareMapOutput(); 00130 void evaluateMaps(); 00131 void closeMapOutput(); 00132 00134 //wns::scheduler::MapInfoCollectionPtr getTxResources(int frameNr); 00135 00137 //lte::timing::SubChannelRangeSet getFreeDLResources(int frameNr, uint32_t groupNumber); 00138 //lte::timing::SubChannelRangeSet getFreeULResources(int frameNr, uint32_t groupNumber); 00139 00140 // fetch scheduled Resources from RS and safe into SuperFrame map 00141 //void saveMap(int frameNr); 00143 virtual void 00144 saveDLMap(int frameNr, wns::scheduler::SchedulingMapPtr schedulingMap); 00146 virtual void 00147 saveULMap(int frameNr, wns::scheduler::SchedulingMapPtr schedulingMap); 00148 00149 //return resourceDedication to RS 00150 //std::string getResourceDedication(int frameNr); 00151 00152 //return scheduling information to the setExpectation method of RS 00153 //wns::scheduler::MapInfoCollectionPtr getFreeDLResources(int frameNr); 00154 //wns::scheduler::MapInfoCollectionPtr getFreeULResources(int frameNr); 00155 00156 void resetResources(int frameNr); 00157 void setCurrentPhase(); 00158 private: 00159 virtual bool doIsAccepting(const wns::ldk::CompoundPtr& /* compound */) const; 00160 virtual void doWakeup(); 00162 void initSuperFrameMap(); 00163 00164 dll::ILayer2* layer2; 00165 wns::node::Interface* myUser; 00166 00167 struct Friends { 00168 Friends() {dlrs=NULL; timer=NULL; phyUser=NULL; associationService=NULL; dlmip=NULL; ulmip=NULL;}; 00169 lte::timing::SchedulerIncoming* dlrs; 00170 lte::timing::TimingScheduler* timer; 00171 lte::macr::PhyUser* phyUser; 00172 dll::services::control::Association* associationService; 00173 wns::scheduler::SchedulingMapProviderInterface* dlmip; 00174 wns::scheduler::SchedulingMapProviderInterface* ulmip; 00175 } friends; 00176 00177 uint32_t pduSize; 00178 uint32_t lowestSubChannel; 00179 uint32_t highestSubChannel; 00180 int framesPerSuperFrame; 00181 00183 //std::vector<lte::timing::SubChannelRangeSet> freeDLResources; 00184 //std::vector<lte::timing::SubChannelRangeSet> freeULResources; 00186 //std::vector<wns::scheduler::UsableSubChannelVector> dlUsableSubChannels; 00187 //std::vector<wns::scheduler::UsableSubChannelVector> ulUsableSubChannels; 00190 // old format: 00191 //MapInfoCollectionVector scheduledDLResources; 00192 //MapInfoCollectionVector scheduledULResources; 00193 // new format: 00194 SchedulingMapCollectionVector scheduledDLResources; 00195 SchedulingMapCollectionVector scheduledULResources; 00198 std::vector<std::string> resourceDedication; 00199 00200 lte::timing::partitioning::PartitioningInfo* partInfo; 00201 00203 wns::service::phy::phymode::PhyModeInterfacePtr phyModePtr; 00205 wns::Power txPower; 00207 bool writeMapOutput; 00208 std::string mapOutputFileNameDL; 00209 std::string mapOutputFileNameUL; 00210 std::ofstream *mapFileDL; 00211 std::ofstream *mapFileUL; 00212 uint32_t currentPhase; 00213 wns::logger::Logger logger; 00214 }; 00215 }} // namespace lte::controlplane 00216 00217 00218 #endif // NOT defined LTE_CONTROLPLANE_MAPHANDLER_HPP 00219 00220
1.5.5