mirror of
				https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
				synced 2025-10-31 03:46:44 +01:00 
			
		
		
		
	Simu: hardcode Signal dependency in Antenna
This commit is contained in:
		
							parent
							
								
									e4af62e51d
								
							
						
					
					
						commit
						aa959f4b3d
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		|  | @ -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. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue