pytwinnet.physics.batch

Functions

path_loss_matrix(twin, tx_nodes, rx_positions)

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:

ndarray

Parameters:
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.