Simu: hardcode Signal dependency in Antenna

This commit is contained in:
Eric Teunis de Boone 2022-03-24 15:48:12 +01:00
parent e4af62e51d
commit aa959f4b3d

View file

@ -1,6 +1,7 @@
from functools import partial from functools import partial
from .location import Location from .location import Location
from ..signals import Signal
class Antenna(Location): class Antenna(Location):
""" """
@ -13,18 +14,18 @@ class Antenna(Location):
def __repr__(self): def __repr__(self):
return "Antenna({})".format(repr(self.x)) 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 Return a function that traces the signal as a function of time
at the antenna's location at the antenna's location
""" """
return partial(travel_signal, x_f=self.x) return partial(signal, x_f=self.x)
receive = recv receive = recv
def emit(self, travel_signal: callable) -> callable:
return partial(travel_signal, x_0=self.x)
class Receiver(Antenna): class Receiver(Antenna):
""" """
An antenna which main purpose is to trace a signal over time. An antenna which main purpose is to trace a signal over time.