mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 11:33:32 +01:00
24 lines
613 B
Python
24 lines
613 B
Python
from functools import partial
|
|
|
|
try:
|
|
from .location import Location
|
|
except ImportError:
|
|
from location import Location
|
|
|
|
class Receiver(Location):
|
|
"""
|
|
A location able to trace a signal over time.
|
|
|
|
Optionally applies a transformation to the traced signal.
|
|
"""
|
|
def __repr__(self):
|
|
return "Receiver({})".format(repr(self.x))
|
|
|
|
def recv(self, travel_signal: callable) -> callable:
|
|
"""
|
|
Return a function that traces the signal as a function of time
|
|
at the receiver's location
|
|
"""
|
|
return partial(travel_signal, x_f=self.x)
|
|
|
|
receive = recv
|