-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightpath.py
57 lines (42 loc) · 1.14 KB
/
lightpath.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Lightpath(object):
def __init__(self,power,path,channel):
self._signal_power=power
self._path=path
self._noise_power=0
self._latency=0
self._channel=channel
# print(self._signal_power)
self.Rs = 32.0e9
self.df = 50.0e9
@property
def channel(self):
return self.channel
@property
def signal_power(self):
return self._signal_power
def set_signal_power(self, signal_power ):
self._signal_power = signal_power
@property
def path(self):
return self._path
@path.setter
def path(self,path):
self._path=path
@property
def noise_power(self):
return self._noise_power
@noise_power.setter
def noise_power(self,noise):
self._noise_power=noise
@property
def latency(self):
return self._latency
@latency.setter
def latency(self,latency ):
self._latency = latency
def add_noise(self,noise ):
self.noise_power += noise
def add_latency(self,latency ):
self.latency += latency
def next(self ):
self.path = self.path[1:]