User Manual, Developers Guide and API Documentation

ARF.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiFiMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2007
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 16, D-52074 Aachen, Germany
00009  * phone: ++49-241-80-27910,
00010  * fax: ++49-241-80-22242
00011  * email: info@openwns.org
00012  * www: http://www.openwns.org
00013  * _____________________________________________________________________________
00014  *
00015  * openWNS is free software; you can redistribute it and/or modify it under the
00016  * terms of the GNU Lesser General Public License version 2 as published by the
00017  * Free Software Foundation;
00018  *
00019  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00020  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00021  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00022  * details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00026  *
00027  ******************************************************************************/
00028 
00029 #ifndef WIFIMAC_LOWERMAC_RATEADAPTATIONSTRATEGIES_ARF_HPP
00030 #define WIFIMAC_LOWERMAC_RATEADAPTATIONSTRATEGIES_ARF_HPP
00031 
00032 #include <WIFIMAC/lowerMAC/rateAdaptationStrategies/IRateAdaptationStrategy.hpp>
00033 #include <WIFIMAC/convergence/PhyUser.hpp>
00034 #include <WIFIMAC/convergence/PhyMode.hpp>
00035 #include <WIFIMAC/lowerMAC/Manager.hpp>
00036 
00037 #include <WNS/ldk/Key.hpp>
00038 #include <WNS/distribution/Uniform.hpp>
00039 #include <WNS/logger/Logger.hpp>
00040 #include <WNS/events/CanTimeout.hpp>
00041 
00042 namespace wifimac { namespace lowerMAC { namespace rateAdaptationStrategies {
00043 
00053     class ARF:
00054         public IRateAdaptationStrategy,
00055         public wns::events::CanTimeout
00056     {
00057     public:
00058         ARF(
00059             const wns::pyconfig::View& _config,
00060             wns::service::dll::UnicastAddress _receiver,
00061             wifimac::management::PERInformationBase* _per,
00062             wifimac::management::SINRInformationBase* _sinr,
00063             wifimac::lowerMAC::Manager* _manager,
00064             wifimac::convergence::PhyUser* _phyUser,
00065             wns::logger::Logger* _logger);
00066 
00067         wifimac::convergence::PhyMode
00068         getPhyMode(size_t numTransmissions) const;
00069 
00070         wifimac::convergence::PhyMode
00071         getPhyMode(size_t numTransmissions,
00072                    const wns::Ratio lqm) const;
00073 
00074         virtual void
00075         setCurrentPhyMode(wifimac::convergence::PhyMode pm);
00076 
00077     private:
00078         void
00079         onTimeout();
00080 
00081         wifimac::management::PERInformationBase* per;
00082         const wns::service::dll::UnicastAddress myReceiver;
00083         const wns::simulator::Time arfTimer;
00084         const bool exponentialBackoff;
00085         const int initialSuccessThreshold;
00086         const int maxSuccessThreshold;
00087         bool timeout;
00088         int successThreshold;
00089         bool probePacket;
00090 
00091         struct Friends
00092         {
00093             wifimac::convergence::PhyUser* phyUser;
00094         } friends;
00095 
00096         wns::logger::Logger* logger;
00097 
00098         wifimac::convergence::PhyMode curPhyMode;
00099     };
00100 }}}
00101 
00102 #endif

Generated on Mon May 21 03:32:14 2012 for openWNS by  doxygen 1.5.5