Skip to content

Commit

Permalink
Add distance override
Browse files Browse the repository at this point in the history
  • Loading branch information
muhd-umer committed Feb 18, 2024
1 parent 5dac080 commit 9926178
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion comyx/network/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
pathloss_args: dict[str, Any],
shape: Tuple[int, ...],
channel_gain: Union[NDArrayComplex, None] = None,
distance: Union[float, None] = None,
) -> None:
"""Initialize a link object.
Expand All @@ -56,14 +57,19 @@ def __init__(
pathloss_args: Arguments for the path loss model.
shape: Shape for the channel gain matrix.
channel_gain: Channel gain values.
distance: Distance between the transceivers.
"""

self.tx = tx
self.rx = rx
self._fading_args = fading_args
self._pathloss_args = pathloss_args
self.shape = shape
self._distance = get_distance(self.tx.position, self.rx.position)
self._distance = (
get_distance(self.tx.position, self.rx.position)
if distance is None
else distance
)
self._pathloss = get_pathloss(self.distance, **self._pathloss_args)

self._channel_gain = (
Expand Down

0 comments on commit 9926178

Please sign in to comment.