pytwinnet.physics.batch¶
Functions
|
Return PL (dB) matrix of shape (T,R) for arbitrary PropagationModel. |
- pytwinnet.physics.batch.path_loss_matrix(twin, tx_nodes, rx_positions)[source]¶
Return PL (dB) matrix of shape (T,R) for arbitrary PropagationModel.
- Return type:
- Parameters:
twin (DigitalTwin)
tx_nodes (List[WirelessNode])
rx_positions (ndarray)
- Fast paths:
If model is FreeSpacePathLoss -> fully vectorized (no Python loops).
If model implements an optional calculate_path_loss_batch(tx_nodes, rx_positions, env) it will be used directly (hook for future custom vectorized models).
- Fallback:
Reuse a single RX WirelessNode and update its .position per point to avoid per-point allocations. This is still scalar but much faster than constructing nodes in a tight loop.