User Manual, Developers Guide and API Documentation

Brown.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 RISE_SCENARIO_MOBILITY_BROWN_HPP
00029 #define RISE_SCENARIO_MOBILITY_BROWN_HPP
00030 
00031 #include <RISE/scenario/mobility/Mobility.hpp>
00032 #include <WNS/geometry/AxisParallelRectangle.hpp>
00033 
00034 #include <WNS/distribution/Uniform.hpp>
00035 
00036 namespace wns { namespace distribution {
00037     class Distribution;
00038 } // distribution
00039 } // wns
00040 
00041 namespace rise { namespace scenario { namespace mobility {
00042 
00051     class BrownianBase :
00052         public Mobility
00053     {
00054     public:
00058         explicit
00059         BrownianBase(const wns::pyconfig::View& mobilityView);
00060 
00062         virtual
00063         ~BrownianBase();
00064 
00071         virtual void
00072         move();
00073 
00077         virtual void
00078         periodically();
00079 
00080     protected:
00084         void
00085         newVelocityVector();
00086 
00091         virtual bool
00092         checkBounds(const wns::Position& pos) const = 0;
00093 
00097         wns::distribution::Distribution* velocityDistribution;
00098 
00103         wns::distribution::Uniform* angleDistribution;
00104 
00108         wns::distribution::StandardUniform* updateProbability;
00109 
00115         wns::PositionOffset velocityVector;
00116 
00120         void
00121         fetchObstructionList(const wns::pyconfig::View& config);
00122 
00124         std::list<wns::geometry::AxisParallelRectangle> obstructionList;
00125 
00127         virtual bool
00128         isObstructed(const wns::Position& pos) const;
00129     private:
00131         void
00132         initRNGs();
00133     };
00134 
00144     class BrownianRect :
00145         public BrownianBase
00146     {
00147     public:
00148         explicit
00149         BrownianRect(const wns::pyconfig::View& mobilityView);
00150 
00151     protected:
00152         virtual bool
00153         checkBounds(const wns::Position& pos) const;
00154 
00155     private:
00159         double xmin, ymin, xmax, ymax;
00160     };
00161 
00171     class BrownianCirc :
00172         public BrownianBase
00173     {
00174     public:
00175         explicit
00176         BrownianCirc(const wns::pyconfig::View& mobilityView);
00177 
00178     protected:
00179         virtual bool
00180         checkBounds(const wns::Position& pos) const;
00181 
00182     private:
00186         wns::Position center;
00187 
00191         double maxDistance;
00192         
00196         int nSectors;
00197     }; // BrownianCirc
00198 
00201     class BrownianEquiangularPolygon :
00202         public BrownianBase
00203     {
00204     public:
00205         explicit
00206         BrownianEquiangularPolygon(const wns::pyconfig::View& mobilityView);
00207 
00208     protected:
00209         virtual bool
00210         checkBounds(const wns::Position& pos) const;
00211 
00212     private:
00216         wns::Position center;
00217 
00221         double maxDistance;
00222 
00226         int corners;
00227 
00231         double angle;
00232     }; // BrownianEquiangularPolygon
00233 
00234 } // mobility
00235 } // scenario
00236 } // rise
00237 
00238 #endif  // RISE_SCENARIO_MOBILITY_BROWN_HPP
00239 
00240 

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