User Manual, Developers Guide and API Documentation

pdf.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. 16, 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_EVALUATION_STATISTICS_PDF_HPP
00029 #define WNS_EVALUATION_STATISTICS_PDF_HPP
00030 
00031 #include <WNS/evaluation/statistics/stateval.hpp>
00032 
00033 #include <vector>
00034 
00035 namespace wns { namespace evaluation { namespace statistics {
00049             class PDF:
00050         public StatEval
00051             {
00052             public:
00053 
00057                 enum scaleType
00058                 {
00059                     logarithmical,
00060                     linear
00061                 };
00062 
00063                 PDF(double minXValue,
00064                     double maxXValue,
00065                     unsigned long int resolution,
00066                     scaleType scaleType,
00067                     formatType format,
00068                     std::string name,
00069                     std::string description);
00070 
00071                 PDF(const wns::pyconfig::View& config);
00072 
00073                 PDF(const PDF& other);
00074 
00075                 virtual ~PDF();
00076 
00080                 virtual void
00081                 print(std::ostream& stream = std::cout) const;
00082 
00086                 virtual void
00087                 put(double value);
00088 
00092                 virtual void
00093                 reset();
00094 
00095             private:
00096 
00100                 void
00101                 getResult(unsigned long int index,
00102                           double& abscissa,
00103                           double& f,
00104                           double& G,
00105                           double& P) const;
00106 
00110                 unsigned long int
00111                 getIndex(double value) const;
00112 
00116                 double
00117                 getAbscissa(unsigned long int index) const;
00118 
00119                 class PercentileError : public std::exception
00120                 {};
00121 
00122                 class PercentileUnderFlow : public PercentileError
00123                 {};
00124 
00125                 class PercentileOverFlow : public PercentileError
00126                 {};
00127 
00132                 double
00133                 getPercentile(int p) const;
00134 
00138                 void printPercentile(int p,
00139                                      std::ostream& stream = std::cout) const;
00140 
00144                 double minXValue_;
00145 
00149                 double maxXValue_;
00150 
00154                 unsigned long int resolution_;
00155 
00159                 scaleType scaleType_;
00160 
00164                 std::vector<int> values_;
00165 
00166                 int underFlows_;
00167 
00168                 int overFlows_;
00169 
00173                 std::string name_;
00174 
00178                 std::string desc;
00179             };
00180 
00181         } // statistics
00182     } // evaluation
00183 } // wns
00184 
00185 #endif  // WNS_EVALUATION_STATISTICS_PDF_HPP
00186 

Generated on Sun May 27 03:31:39 2012 for openWNS by  doxygen 1.5.5