Skip to content
Snippets Groups Projects

Feat: implement spreading loss for PPE

Merged LuoYfTHU requested to merge feature/spreading_loss into propagationParameterCalculation

Files

#ifndef INCLUDE_WATCHER_PP_PROPAGATION_DELAY
#define INCLUDE_WATCHER_PP_PROPAGATION_DELAY
#include <ITAPropagationModels/Definitions.h>
#include <ITAPropagationModels/PropagationParameterEngine/AuUnits.h>
#include <ITAPropagationModels/PropagationParameterEngine/PropagationModules/BaseModule.h>
#include <ITAPropagationModels/PropagationParameterEngine/PropagationParameters/SingleData.h>
#include <ITAPropagationModels/PropagationParameterEngine/UtilsPPE.h>
#include <memory>
#include <propagation_path_list/propagation_path_list.hpp>
#include <string>
namespace ITAPropagationModels
{
namespace PPE
{
namespace PropModules
{
///
/// \brief Module to compute the spreading loss for a given propagation path list.
///
/// The calculation is based on the paper "A uniform geometrical theory of diffraction for an edge in a perfectly conducting surface" by R. G. Kouyoumjian and
/// P. H. Pathak, Equation (23).
///
class ITA_PROPAGATION_MODELS_API CSpreadingLoss : public CBaseModules
{
public:
CSpreadingLoss( );
~CSpreadingLoss( ) = default;
PPLResults compute( const propagation_path_list::PropagationPathList& ppl ) override;
EModuleIdentifier get_identifier( ) const override { return EModuleIdentifier::SPREADING_LOSS; };
private:
///
/// \brief Compute the length of each section of a propagation path.
///
/// In this context, a section is defined as the distance between diffraction anchors.
/// This is done, because the spreading loss is calculated differently for spherical and cylindrical waves.
/// Considering spherical waves emanating from a point source, spherical spreading loss needs to be calculated when a reflection or the receiver is
/// encountered.
/// When a diffraction is encountered, the diffracted wave is emanating from a virtual line source along the edge of the diffracting object.
/// Therefore, cylindrical spreading loss needs to be calculated following a diffraction.
/// \param ppl Propagation path list to compute the section lengths for.
/// \return A map containing the path identifier as key and a vector of section lengths as value.
///
std::unordered_map<std::string, std::vector<decltype( au::meters( float( ) ) )>> compute_sound_path_section_length(
const propagation_path_list::PropagationPathList& ppl );
///
/// \brief Compute the spreading loss for a given propagation path list.
///
/// This method does the actual computation of the spreading loss for a given propagation path list.
/// \param ppl Propagation path list to compute the spreading loss for.
/// \return PPLResults containing the spreading loss for each path.
///
PPLResults compute_spreading_loss_list( const propagation_path_list::PropagationPathList& ppl );
bool m_spherical_only = false;
};
} // namespace PropModules
} // namespace PPE
} // namespace ITAPropagationModels
#endif // !INCLUDE_WATCHER_PP_PROPAGATION_DELAY
Loading