6#ifndef SIONNA_RT_CHANNEL_MODEL_H
7#define SIONNA_RT_CHANNEL_MODEL_H
11#include "ns3/angles.h"
12#include "ns3/antenna-model.h"
13#include "ns3/boolean.h"
14#include "ns3/vector.h"
17#include <pybind11/embed.h>
18#include <pybind11/numpy.h>
19#include <unordered_map>
32 "simple_street_canyon",
33 "simple_street_canyon_with_cars",
37namespace py = pybind11;
487 py::object
LoadScene(
const py::module_ rt)
const;
505 const py::object paths,
506 const py::object scene)
const;
520 const uint8_t numpol)
const;
539 py::object
CalculatePaths(
const py::module_ rt,
const py::object scene);
566 py::object paths)
const;
595 std::string Angle)
const;
648 std::unordered_map<uint64_t, Ptr<ChannelMatrix>>
652 std::unordered_map<uint64_t, Ptr<SionnaRtChannelParams>>
This is an interface for a channel model that can be described by a channel matrix,...
std::vector< double > DoubleVector
Type definition for vectors of doubles.
ComplexMatrixArray Complex3DVector
Create an alias for 3D complex vectors.
Keep track of the current position and velocity of an object.
Smart pointer class similar to boost::intrusive_ptr.
static TypeId GetTypeId()
Get the ns-3 TypeId for this class.
std::vector< double > CalculateDopplerFromPaths(const py::module_ np, py::object paths) const
Extract Doppler shifts per path from the Python paths object.
bool DoesNumberOfPathsExceedMaximum(size_t numPaths) const
Determine if the path count exceeds the configured maximum threshold.
void SetMergeShapeEnable(bool cond)
Enable or disable shape merging when loading scenes from sionna.rt.
double m_maxNumberOfPaths
Maximum number of paths to be generated by the path solver.
virtual Ptr< ChannelMatrix > GetNewChannel(py::object paths, const Ptr< const MobilityModel > sMob, const Ptr< const MobilityModel > uMob, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna) const
Compute a new channel matrix for the given node pair using Sionna RT.
Vector m_cameraPosition
Camera position/look-at used by the scene rendering pipeline.
std::string m_outputImageDirectory
Output directory.
RtPathSolverConfig GetRtPathSolverConfig() const
Retrieve the current path solver configuration.
bool GetNormalizeDelays() const
Query whether path delay normalization is enabled.
Time m_updatePeriod
Channel update period used to decide whether to re-run path computations.
MatrixBasedChannelModel::DoubleVector CalculateAnglesFromPaths(const py::module_ np, py::object paths, std::string Angle) const
Extract angular measurements (AOD/AOA/ZOA/ZOD) from the paths.
~SionnaRtChannelModel() override
Destructor.
Complex3DVector CalculateCirFromPaths(const py::object paths) const
Convert calculated paths into channel impulse responses (CIRs).
void SetRtPathSolverConfig(RtPathSolverConfig configs)
Configure the Sionna RT path solver behavior.
RtPathSolverConfig m_RtPathSolverConfig
Path solver configuration used when computing paths.
void SetNormalizeDelays(bool cond)
Enable or disable normalization of path delays in Sionna RT.
RtSceneConfig m_sceneConfigs
High-level scene configuration.
std::unordered_map< uint64_t, Ptr< SionnaRtChannelParams > > m_channelParamsMap
map containing the common channel parameters per pair of nodes, the key of this map is reciprocal and...
double GetMaxNumberOfPaths() const
Get the configured maximum number of propagation paths.
bool ChannelMatrixNeedsUpdate(Ptr< const ChannelMatrix > channelMatrix) const
Determine whether an existing ChannelMatrix must be updated.
std::string GetAntennaElementPattern(Ptr< const AntennaModel > element) const
Return a string describing the antenna element pattern for Sionna.
Vector m_cameraLookAt
Camera look-at point for scene rendering.
bool m_isImageRendered
Control for whether we should render a scene image.
py::object MakePlannarArray(const py::module_ rt, Ptr< const PhasedArrayModel > antenna) const
Build a Sionna PlanarArray description from an ns-3 PhasedArrayModel.
bool m_normalizeDelays
Whether Sionna RT should normalize path delays in CIR output.
std::string m_outputImageName
Output image rendering options (file name/directory).
double GetFrequency() const
Get the configured center frequency.
py::object LoadScene(const py::module_ rt) const
Load a Sionna RT scene using the configured scenario name.
py::object CalculatePaths(const py::module_ rt, const py::object scene)
Compute propagation paths between transmitter and receiver.
int64_t AssignStreams(int64_t stream)
Assign stream indices to any random variables used internally.
void SetFrequency(double f)
Set the center frequency used by the model and scene factories.
bool AntennaSetupChanged(Ptr< const PhasedArrayModel > aAntenna, Ptr< const PhasedArrayModel > bAntenna, Ptr< const ChannelMatrix > channelMatrix) const
Check whether antenna configuration changes require regenerating the channel matrix.
Ptr< const ChannelMatrix > GetChannel(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob, Ptr< const PhasedArrayModel > aAntenna, Ptr< const PhasedArrayModel > bAntenna) override
Retrieve or generate the channel matrix for the node pair.
py::object CreateScene(const py::module_ rt, const Ptr< const MobilityModel > sMob, const Ptr< const MobilityModel > uMob, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna) const
Create a sionna.rt scene object for the provided endpoints and antennas.
std::unordered_map< uint64_t, Ptr< ChannelMatrix > > m_channelMatrixMap
map containing the channel realizations per pair of PhasedAntennaArray instances, the key of this map...
Ptr< MatrixBasedChannelModel::ChannelMatrix > CreateNewMatrixChannel(const Complex3DVector hUsn, const Ptr< const MobilityModel > sMob, const Ptr< const MobilityModel > uMob, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna) const
Create a new ChannelMatrix object wrapping a precomputed CIR tensor.
MatrixBasedChannelModel::DoubleVector CalculateTauFromPaths(const py::module_ np, py::object paths) const
Extract delays (tau) per path from RS paths object.
void SetMaxNumberOfPaths(double p)
Set the maximum number of propagation paths to retain.
void SetScenario(const std::string &scenario)
Set the propagation scenario name used by sionna.rt scene factories.
std::string GetPolarizationFromPolSlantAngle(const double polSlantAngle, const uint8_t numpol) const
Convert a polarization slant angle into Sionna RT string representation.
std::string GetScenario() const
Return the configured propagation scenario name.
Ptr< SionnaRtChannelParams > CalculateChannelParamsFromPaths(const py::object paths, Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob) const
Build ChannelParams metadata from Sionna RT paths object.
void DoDispose() override
Release references and perform cleanup.
SionnaRtChannelModel()
Constructor.
size_t GetNumberOfPathsFromCir(const py::object paths) const
Extract the number of propagation paths from the CIR tensor.
Ptr< const ChannelParams > GetParams(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob) const override
Get channel parameters (path info) for a node pair if available.
void SceneRenderImageToFile(const py::module_ rt, const py::object paths, const py::object scene) const
Render a visualization of the scene and paths to a PNG image file.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const std::set< std::string > builtInSceneSionna
Data structure that stores channel parameters.
Configuration for the Sionna RT PathSolver.
bool diffuseReflection
Enable diffuse reflections (scattering).
bool syntheticArray
Use synthetic array processing (if supported by scene factory).
bool specularReflection
Enable specular reflections (mirror-like).
bool los
Include direct line-of-sight (LOS) path when true It only controls whether the solver should include ...
int seed
Random seed for stochastic components (e.g., diffuse scattering).
int maxDepth
Maximum number of interactions (reflection/refraction depth).
bool edgeDiffraction
Enable edge diffraction (alternative diffraction handling).
bool diffraction
Enable diffraction.
bool refraction
Enable refraction through transparent bodies / materials.
Scene high-level configuration.
std::string sceneName
Which scene factory in sionna.rt.scene to call. Example: "munich".
bool mergeShapes
Whether to merge shapes during load_scene(...) to reduce geometry complexity.
double frequency
the operating frequency
ChannelParams extension to carry Sionna-specific metadata.
std::vector< double > m_doppler
Doppler shifts per cluster/path (complex vector indexed by path).