User Manual, Developers Guide and API Documentation

ErrorProbability.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiMeMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2011
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 5, 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 WIMEMAC_MANAGEMENT_PROTOCOLCALCULATORPLUGINS_ERRORPROBABILITY_HPP
00030 #define WIMEMAC_MANAGEMENT_PROTOCOLCALCULATORPLUGINS_ERRORPROBABILITY_HPP
00031 
00032 #include <WIMEMAC/convergence/PhyMode.hpp>
00033 
00034 #include <WNS/pyconfig/View.hpp>
00035 #include <WNS/PowerRatio.hpp>
00036 
00037 namespace wimemac { namespace management { namespace protocolCalculatorPlugins {
00038 
00039     struct ErrorStatistic
00040     {
00042         double per;
00044         double ber;
00046         double u;
00048         double ser;
00049 
00050         ErrorStatistic()
00051             {
00052                 per = -1.0;
00053                 ber = -1.0;
00054                 u = -1.0;
00055                 ser = -1.0;
00056             };
00057 
00058         bool valid() const
00059             {
00060                 return((per >= 0.0 and per <= 1.0) and
00061                        (ber >= 0.0 and ber <= 1.0) and
00062                        (u >= 0.0 and u <= 1.0) and
00063                        (ser >= 0.0 and ser <= 1.0));
00064             }
00065     };
00066 
00071     class ErrorProbability
00072     {
00073     public:
00074         ErrorProbability();
00075 
00076         ErrorStatistic
00077         getError(wns::Ratio postSNR, Bit packetLength, wimemac::convergence::PhyMode phyMode) const;
00078 
00079         double
00080         getPER(wns::Ratio postSNR, Bit packetLength, wimemac::convergence::PhyMode phyMode) const;
00081 
00082     private:
00085         double Pd(double rawBer, double d) const;
00086 
00088         double Pu12(double rawBer) const;
00089 
00091         double Pu23(double rawBer) const;
00092 
00094         double Pu34(double rawBer) const;
00095 
00097         double Pu56(double rawBer) const;
00098 
00100         double Q(double x) const;
00101 
00102     };
00103 } // protocolCalculatorPlugins
00104 } // management
00105 } // wimemac
00106 
00107 #endif

Generated on Sun May 27 03:32:12 2012 for openWNS by  doxygen 1.5.5