From aa959f4b3db7f169999b5126ed9e273d82ff0f70 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 24 Mar 2022 15:48:12 +0100 Subject: [PATCH] Simu: hardcode Signal dependency in Antenna --- simulations/lib/location/antenna.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/simulations/lib/location/antenna.py b/simulations/lib/location/antenna.py index 6760345..8ad984c 100644 --- a/simulations/lib/location/antenna.py +++ b/simulations/lib/location/antenna.py @@ -1,6 +1,7 @@ from functools import partial from .location import Location +from ..signals import Signal class Antenna(Location): """ @@ -13,18 +14,18 @@ class Antenna(Location): def __repr__(self): return "Antenna({})".format(repr(self.x)) - def recv(self, travel_signal: callable) -> callable: + def emit(self, signal: Signal) -> callable: + return partial(signal, x_0=self.x) + + def recv(self, signal: Signal) -> callable: """ Return a function that traces the signal as a function of time at the antenna's location """ - return partial(travel_signal, x_f=self.x) + return partial(signal, x_f=self.x) receive = recv - def emit(self, travel_signal: callable) -> callable: - return partial(travel_signal, x_0=self.x) - class Receiver(Antenna): """ An antenna which main purpose is to trace a signal over time.