User Manual, Developers Guide and API Documentation

ResourceScheduler.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_RESOURCESCHEDULERTX_HPP
00029 #define LTE_TIMING_RESOURCESCHEDULERTX_HPP
00030 
00031 #include <LTE/timing/ResourceSchedulerInterface.hpp>
00032 #include <LTE/macr/Scorer.hpp>
00033 #include <LTE/helper/HasModeName.hpp>
00034 
00035 #include <DLL/services/control/Association.hpp>
00036 
00037 // Forward declarations would be sufficient here
00038 // For convenience we include here.
00039 #include <WNS/scheduler/MapInfoProviderInterface.hpp>
00040 #include <WNS/scheduler/RegistryProxyInterface.hpp>
00041 #include <WNS/scheduler/queue/QueueInterface.hpp>
00042 #include <WNS/scheduler/harq/HARQInterface.hpp>
00043 #include <WNS/scheduler/strategy/StrategyInterface.hpp>
00044 #include <WNS/scheduler/grouper/SpatialGrouper.hpp>
00045 #include <WNS/ldk/FunctionalUnit.hpp>
00046 #include <WNS/service/dll/FlowID.hpp>
00047 #include <WNS/probe/bus/ContextCollector.hpp>
00048 
00049 #include <map>
00050 #include <list>
00051 
00052 namespace lte {
00053 
00054 // Forward declarations
00055 namespace rlc { class RLC; }
00056 namespace macg { class MACg; }
00057 namespace macr { class PhyUser; }
00058 namespace controlplane { class IMapHandlerRS; }
00059 namespace controlplane { class RRHandler; }
00060 namespace controlplane { namespace flowmanagement { class FlowManager; } }
00061 namespace controlplane { namespace associationHandler { class AssociationHandlerBS; } }
00062 namespace timing { class TimingScheduler; class RegistryProxy;}
00063 namespace timing { namespace partitioning { class PartitioningInfo;}}
00064 namespace helper { class QueueProxy; }
00065 
00066 namespace timing {
00067 
00072 class ResourceScheduler :
00073         virtual public SchedulerFUInterface,
00074         virtual public SchedulerOutgoing,
00075         virtual public SchedulerIncoming,
00076         virtual public wns::ldk::FunctionalUnit,
00077         public wns::ldk::CommandTypeSpecifier<SchedulerCommand>,
00078         virtual public wns::scheduler::SchedulingMapProviderInterface,
00079         virtual public macr::ScorerInterface,
00080         public lte::helper::HasModeName,
00081         public dll::services::control::AssociationObserver
00082 {
00083     friend class controlplane::associationHandler::AssociationHandlerBS;
00084 
00090     typedef std::map<wns::service::dll::UnicastAddress,
00091                      wns::service::dll::UnicastAddress> SeenTable;
00092 
00093     typedef std::list<wns::ldk::CompoundPtr> CompoundList;
00094 
00095 public:
00096     ResourceScheduler(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00097 
00098     virtual ~ResourceScheduler();
00099 
00102 
00106     virtual bool
00107     doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00108 
00113     virtual void
00114     doSendData(const wns::ldk::CompoundPtr& compound);
00115 
00119     virtual void
00120     doOnData(const wns::ldk::CompoundPtr& compound);
00121 
00125     void
00126     postDecoding(const wns::ldk::CompoundPtr compound);
00127 
00131     virtual void
00132     doWakeup();
00133 
00135 
00138 
00143     wns::scheduler::SchedulingMapPtr
00144     getSchedulingMap(int frameNr) const;
00146 
00149 
00156     void
00157     finishCollection(int frameNr, simTimeType _startTime);
00159 
00160     virtual void
00161     resetHARQScheduledPeerRetransmissions();
00162 
00163     virtual void
00164     sendPendingHARQFeedback();
00165 
00173     virtual void
00174     onNodeCreated();
00176 
00185     virtual void
00186     onFUNCreated();
00187 
00191     virtual void
00192     onAssociated(wns::service::dll::UnicastAddress userAdr,
00193                  wns::service::dll::UnicastAddress dstAdr) = 0;
00194 
00198     virtual void
00199     onDisassociated(wns::service::dll::UnicastAddress userAdr,
00200                     wns::service::dll::UnicastAddress dstAdr) = 0;
00201 
00202     virtual void
00203     onFlowReleased(wns::service::dll::FlowID flowId,
00204                    wns::scheduler::UserID user /*nextHop!*/);
00205 
00212     virtual lte::helper::Route
00213     score(const wns::ldk::CompoundPtr& compound);
00215 
00219     int
00220     getPartitionGroup();
00221 
00225     void
00226     prepareMapOutput();
00227 
00228     void
00229     evaluateMap(wns::scheduler::SchedulingMapPtr schedulingMap, int frameNr);
00230 
00231     void
00232     closeMapOutput();
00233 
00234 protected:
00238     void
00239     startCollection(int frameNr, simTimeType duration);
00240 
00245     void
00246     deliverSchedulingTimeSlot(bool canBeDecoded,
00247                               const wns::scheduler::SchedulingTimeSlotPtr& schedulingTimeSlot,
00248                               wns::service::phy::power::PowerMeasurementPtr&,
00249                               int subband);
00250 
00251     virtual void
00252     deliverReceived();
00253 
00254     virtual void
00255     applyPowerLimitation(wns::scheduler::SchedulingMapPtr);
00256 
00257     void 
00258     probeResourceUsage(wns::scheduler::SchedulingMapPtr schedulingMap);
00259 
00261     wns::pyconfig::View pyConfig;
00262 
00263     wns::logger::Logger logger;
00264 
00265     dll::ILayer2* layer2;
00266 
00270     dll::services::control::Association* associationService;
00271 
00275     struct Friends {
00276         Friends()
00277             {
00278                 rlcReader=NULL; macg=NULL; phyUser=NULL; timer=NULL;
00279                 flowManager=NULL; mapHandler=NULL; rrHandler=NULL; partitioningInfo=NULL;
00280             };
00281 
00282         wns::ldk::CommandReaderInterface* rlcReader;
00283         lte::macg::MACg* macg;
00284         lte::macr::PhyUser* phyUser;
00285         lte::timing::TimingScheduler* timer;
00286         lte::controlplane::flowmanagement::FlowManager* flowManager;
00287         lte::controlplane::IMapHandlerRS* mapHandler;
00288         lte::controlplane::RRHandler* rrHandler;
00289         lte::timing::partitioning::PartitioningInfo* partitioningInfo;
00290     } friends;
00291 
00295     struct Colleagues {
00296         Colleagues()
00297             {
00298                 registry=NULL; strategy=NULL; queue=NULL; queueProxy=NULL;
00299                 grouper=NULL; harq=NULL;
00300             };
00301         wns::scheduler::strategy::StrategyInterface* strategy;
00302         lte::timing::RegistryProxy* registry;
00303         //wns::scheduler::RegistryProxyInterface* registry;
00304         wns::scheduler::queue::QueueInterface* queue;
00305         lte::helper::QueueProxy* queueProxy;
00306         wns::scheduler::grouper::GroupingProviderInterface* grouper;
00307         wns::scheduler::harq::HARQInterface* harq;
00308     } colleagues;
00309 
00313     int framesPerSuperFrame;
00314 
00318     simTimeType slotDuration;
00319 
00323     unsigned int freqChannels;
00324 
00329     unsigned int numberOfTimeSlots;
00330 
00336     unsigned int maxBeams;
00337 
00341     bool beamforming;
00342 
00347     int partitionGroup;
00348 
00352     wns::scheduler::strategy::StrategyResultHistory schedulingResultOfFrame;
00353 
00357     lte::macr::Scorer scorer;
00358 
00362     wns::probe::bus::ContextCollectorPtr resUsageProbe_;
00363 
00367     wns::scheduler::SchedulerSpotType schedulerSpot;
00368 
00373     bool IamUplinkMaster;
00374 
00378     bool writeMapOutput;
00379 
00380     std::string mapOutputFileName;
00381 
00382     std::ofstream *mapFile;
00383 
00384     long int transportBlockCounter;
00385 
00386     wns::scheduler::harq::HARQInterface::DecodeStatusContainer receivedNonHARQTimeslots_;
00387 
00388     wns::Power maxTxPower;
00389 };
00390 }
00391 } // lte::timing
00392 
00393 #endif // NOT defined ...

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