NMPB08 Shared Libraries
CalculPropagation.h
Go to the documentation of this file.
00001 
00008 #ifndef CALCUL_PROPAGATION_H
00009 #define CALCUL_PROPAGATION_H
00010 
00011 #include "PathStructures.h"
00012 #include <vector>
00013 #include <math.h>
00014 #include <map>
00015 #include <stdlib.h>
00016 #include <string.h>
00017 using namespace std;
00018 
00019 // on Unix-like systems there is no way_ to hide local classes ant to prevent them from 
00020 // being replaced by other classes with similar names in other libraries. The use of 
00021 // unusual names may help preventing name clashes.
00022 
00023 #ifndef _WIN32
00024 #define  Attenuation   _Local_PROPAN8_Attenuation_
00025 #endif
00026 
00027 namespace CalculPropagationNMPB
00028 {
00040         double SumLevels(int n, double const* levels);
00041 
00057         double SoundLevelForPath(double soundLevel_h, double soundLevel_f, double favourableProbability);
00058 
00076         double GetFavorableConditionProbability(Position3D const* sourcePos, Position3D const* receiverPos, int nbAngles, double const* fcpAngles, double angleNorth);
00077 
00097         void CalculateLeqLT(int nbFreq, double const* Lw, double const* attH, double const* attF, double fcp, double* LeqH, double* LeqF, double* LeqLT);
00098 
00102         class Attenuation
00103     {
00104     public:
00105 
00113                 Attenuation(PropagationPath* path, double frequency);
00114 
00124                 Attenuation(PropagationPath* path, double frequency, double favourableProbability);
00125 
00136                 double DivergenceAttenuationCalculation(double dist);
00137 
00150                 double AtmosphericAbsorptionCalculation(double dist, double freq);
00151 
00163                 void BoundaryAttenuationCalculation(int nbSideDiffractions);
00164 
00173         void AttenuationCalculation();
00174 
00180                 void FillFrequencyMap(map<int,double> newMap);
00181 
00187                 double getHomogeneousAttenuation()
00188                 {
00189                         return _attenuation_h;
00190                 }
00191 
00197                 double getFavorableAttenuation()
00198                 {
00199                         return _attenuation_f;
00200                 }
00201 
00207                 double getDivergenceAttenuation()
00208                 {
00209                         return _divergenceAttenuation;
00210                 }
00211 
00217                 double getAtmosphericAbsorption()
00218                 {
00219                         return _atmosphericAbsorption;
00220                 }
00221 
00227                 double getGroundAttenuation_h()
00228                 {
00229                         return _groundAttenuation_h;
00230                 }
00231 
00237                 double getGroundAttenuation_f()
00238                 {
00239                         return _groundAttenuation_f;
00240                 }
00241                 
00247                 double getDiffractionAttenuation_h()
00248                 {
00249                         return _diffractionAttenuation_h;
00250                 }
00251                 
00257                 double getDiffractionAttenuation_f()
00258                 {
00259                         return _diffractionAttenuation_f;
00260                 }
00261 
00267                 double getEmbankmentAttenuation()
00268                 {
00269                         return _embankmentAttenuation_h;
00270                 }
00271 
00277                 double getBoundaryAttenuation_h()
00278                 {
00279                         return _boundaryAttenuation_h;
00280                 }
00281 
00287                 double getBoundaryAttenuation_f()
00288                 {
00289                         return _boundaryAttenuation_f;
00290                 }
00291 
00292         private:
00296                 PropagationPath* _path; 
00300                 double _frequency; 
00304                 double _favourableProbability;
00305 
00309                 double _attenuation_h;
00313                 double _attenuation_f;
00317                 double _divergenceAttenuation;
00321                 double _atmosphericAbsorption;
00325                 double _boundaryAttenuation_h;
00329                 double _boundaryAttenuation_f;
00333                 double _groundAttenuation_h;
00337                 double _groundAttenuation_f;
00341                 double _diffractionAttenuation_h;
00345                 double _diffractionAttenuation_f;
00349                 double _embankmentAttenuation_h;
00353                 double _embankmentAttenuation_f;
00354 
00358                 map<int,double> _attenuationCoeffByFrequencyMap;
00359 
00365                 void FillFrequencyMap();
00366 
00367                 // to know if calculation steps must be displayed on console
00368                 bool _displayConsoleStep;
00369 
00370                 // enable/disable correction for low barrier heights 
00371                 bool _withCh ;
00379                 void GroundAttenuationCalculation();
00380 
00387                 void EmbankmentAttenuationCalculation();
00388 
00400                 double AttenuationCoeffByFrequency(double freq);
00401 
00405                 void ClearResults();
00406 
00407     };
00408 }
00409 
00410 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines