vlcSim 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vlcSim-0.2.4 → vlcSim-0.2.6}/PKG-INFO +26 -20
- {vlcSim-0.2.4 → vlcSim-0.2.6}/README.md +25 -19
- {vlcSim-0.2.4 → vlcSim-0.2.6}/setup.py +1 -1
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/PKG-INFO +26 -20
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcsim/controller.py +8 -4
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcsim/scene.py +126 -1
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcsim/simulator.py +2 -10
- {vlcSim-0.2.4 → vlcSim-0.2.6}/LICENSE.md +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/setup.cfg +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/test/test_receiver.py +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/test/test_scenario.py +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/test/test_vled.py +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/SOURCES.txt +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/dependency_links.txt +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/not-zip-safe +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/requires.txt +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcSim.egg-info/top_level.txt +0 -0
- {vlcSim-0.2.4 → vlcSim-0.2.6}/vlcsim/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vlcSim
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Python Package of Event-Oriented Simulation for visible light communication
|
|
5
5
|
Home-page: https://gitlab.com/DaniloBorquez/simvlc/
|
|
6
6
|
Author: Danilo Bórquez-Paredes
|
|
@@ -45,17 +45,28 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
45
45
|
for vled in vleds:
|
|
46
46
|
capacities.append(scenario.capacityVled(receiver, vled))
|
|
47
47
|
posBestCapacity = capacities.index(max(capacities))
|
|
48
|
-
|
|
48
|
+
numberOfSlices = 0
|
|
49
|
+
if (
|
|
50
|
+
controller.numberOfActiveConnections(vleds[posBestCapacity]) > 5
|
|
51
|
+
or capacities[posBestCapacity] == 0
|
|
52
|
+
):
|
|
49
53
|
connection.AP = scenario.rfs[0]
|
|
54
|
+
connection.receiver.capacityFromAP = scenario.capacityRf(
|
|
55
|
+
receiver, connection.AP
|
|
56
|
+
)
|
|
57
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
58
|
+
connection.capacityRequired, connection.receiver.capacityFromAP
|
|
59
|
+
)
|
|
50
60
|
else:
|
|
51
61
|
connection.AP = vleds[posBestCapacity]
|
|
62
|
+
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
63
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
64
|
+
connection.capacityRequired, capacities[posBestCapacity]
|
|
65
|
+
)
|
|
52
66
|
|
|
53
|
-
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
54
|
-
connection.capacityRequired, capacities[posBestCapacity]
|
|
55
|
-
)
|
|
56
|
-
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
57
67
|
actualSlice = connection.nextSliceInAPWhenArriving(connection.AP)
|
|
58
68
|
aux = 0
|
|
69
|
+
auxFrame = 0
|
|
59
70
|
|
|
60
71
|
# Actual frame
|
|
61
72
|
for slice in range(actualSlice, connection.AP.slicesInFrame):
|
|
@@ -73,12 +84,13 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
73
84
|
if controller.framesState(connection.AP)[frameIndex][slice] == False:
|
|
74
85
|
connection.assignFrameSlice(frameIndex, slice)
|
|
75
86
|
aux += 1
|
|
87
|
+
auxFrame = frameIndex
|
|
76
88
|
break
|
|
77
89
|
|
|
78
90
|
if aux == numberOfSlices:
|
|
79
91
|
break
|
|
80
92
|
|
|
81
|
-
frameIndex =
|
|
93
|
+
frameIndex = auxFrame + 1
|
|
82
94
|
while aux < numberOfSlices:
|
|
83
95
|
connection.assignFrameSlice(frameIndex, 0)
|
|
84
96
|
frameIndex += 1
|
|
@@ -89,25 +101,25 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
89
101
|
if __name__ == "__main__":
|
|
90
102
|
# Simulator Constructor: size of the room, with the numbrer of grids and the rho parameter
|
|
91
103
|
|
|
92
|
-
sim = Simulator(
|
|
104
|
+
sim = Simulator(20.0, 20.0, 2.15, 10, 0.8)
|
|
93
105
|
|
|
94
106
|
# Adding Vleds to the room
|
|
95
|
-
vled = VLed(-
|
|
107
|
+
vled = VLed(-7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
96
108
|
vled.sliceTime = 0.2
|
|
97
109
|
vled.slicesInFrame = 10
|
|
98
110
|
vled.B = 0.5e5
|
|
99
111
|
sim.scenario.addVLed(vled)
|
|
100
|
-
vled = VLed(-
|
|
112
|
+
vled = VLed(-7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
101
113
|
vled.sliceTime = 0.2
|
|
102
114
|
vled.slicesInFrame = 10
|
|
103
115
|
vled.B = 0.5e5
|
|
104
116
|
sim.scenario.addVLed(vled)
|
|
105
|
-
vled = VLed(
|
|
117
|
+
vled = VLed(7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
106
118
|
vled.sliceTime = 0.2
|
|
107
119
|
vled.slicesInFrame = 10
|
|
108
120
|
vled.B = 0.5e5
|
|
109
121
|
sim.scenario.addVLed(vled)
|
|
110
|
-
vled = VLed(
|
|
122
|
+
vled = VLed(7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
111
123
|
vled.sliceTime = 0.2
|
|
112
124
|
vled.slicesInFrame = 10
|
|
113
125
|
vled.B = 0.5e5
|
|
@@ -122,11 +134,11 @@ if __name__ == "__main__":
|
|
|
122
134
|
|
|
123
135
|
# setting algorithm and number of connections
|
|
124
136
|
sim.set_allocation_algorithm(alloc)
|
|
125
|
-
sim.goalConnections =
|
|
137
|
+
sim.goalConnections = 60
|
|
126
138
|
|
|
127
139
|
# changing Dynamic
|
|
128
140
|
sim.lambdaS = 1
|
|
129
|
-
sim.mu =
|
|
141
|
+
sim.mu = 30
|
|
130
142
|
|
|
131
143
|
# changing random wait limits
|
|
132
144
|
|
|
@@ -139,9 +151,3 @@ if __name__ == "__main__":
|
|
|
139
151
|
# initialize and run
|
|
140
152
|
sim.init()
|
|
141
153
|
sim.run()
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
@@ -31,17 +31,28 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
31
31
|
for vled in vleds:
|
|
32
32
|
capacities.append(scenario.capacityVled(receiver, vled))
|
|
33
33
|
posBestCapacity = capacities.index(max(capacities))
|
|
34
|
-
|
|
34
|
+
numberOfSlices = 0
|
|
35
|
+
if (
|
|
36
|
+
controller.numberOfActiveConnections(vleds[posBestCapacity]) > 5
|
|
37
|
+
or capacities[posBestCapacity] == 0
|
|
38
|
+
):
|
|
35
39
|
connection.AP = scenario.rfs[0]
|
|
40
|
+
connection.receiver.capacityFromAP = scenario.capacityRf(
|
|
41
|
+
receiver, connection.AP
|
|
42
|
+
)
|
|
43
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
44
|
+
connection.capacityRequired, connection.receiver.capacityFromAP
|
|
45
|
+
)
|
|
36
46
|
else:
|
|
37
47
|
connection.AP = vleds[posBestCapacity]
|
|
48
|
+
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
49
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
50
|
+
connection.capacityRequired, capacities[posBestCapacity]
|
|
51
|
+
)
|
|
38
52
|
|
|
39
|
-
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
40
|
-
connection.capacityRequired, capacities[posBestCapacity]
|
|
41
|
-
)
|
|
42
|
-
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
43
53
|
actualSlice = connection.nextSliceInAPWhenArriving(connection.AP)
|
|
44
54
|
aux = 0
|
|
55
|
+
auxFrame = 0
|
|
45
56
|
|
|
46
57
|
# Actual frame
|
|
47
58
|
for slice in range(actualSlice, connection.AP.slicesInFrame):
|
|
@@ -59,12 +70,13 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
59
70
|
if controller.framesState(connection.AP)[frameIndex][slice] == False:
|
|
60
71
|
connection.assignFrameSlice(frameIndex, slice)
|
|
61
72
|
aux += 1
|
|
73
|
+
auxFrame = frameIndex
|
|
62
74
|
break
|
|
63
75
|
|
|
64
76
|
if aux == numberOfSlices:
|
|
65
77
|
break
|
|
66
78
|
|
|
67
|
-
frameIndex =
|
|
79
|
+
frameIndex = auxFrame + 1
|
|
68
80
|
while aux < numberOfSlices:
|
|
69
81
|
connection.assignFrameSlice(frameIndex, 0)
|
|
70
82
|
frameIndex += 1
|
|
@@ -75,25 +87,25 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
75
87
|
if __name__ == "__main__":
|
|
76
88
|
# Simulator Constructor: size of the room, with the numbrer of grids and the rho parameter
|
|
77
89
|
|
|
78
|
-
sim = Simulator(
|
|
90
|
+
sim = Simulator(20.0, 20.0, 2.15, 10, 0.8)
|
|
79
91
|
|
|
80
92
|
# Adding Vleds to the room
|
|
81
|
-
vled = VLed(-
|
|
93
|
+
vled = VLed(-7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
82
94
|
vled.sliceTime = 0.2
|
|
83
95
|
vled.slicesInFrame = 10
|
|
84
96
|
vled.B = 0.5e5
|
|
85
97
|
sim.scenario.addVLed(vled)
|
|
86
|
-
vled = VLed(-
|
|
98
|
+
vled = VLed(-7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
87
99
|
vled.sliceTime = 0.2
|
|
88
100
|
vled.slicesInFrame = 10
|
|
89
101
|
vled.B = 0.5e5
|
|
90
102
|
sim.scenario.addVLed(vled)
|
|
91
|
-
vled = VLed(
|
|
103
|
+
vled = VLed(7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
92
104
|
vled.sliceTime = 0.2
|
|
93
105
|
vled.slicesInFrame = 10
|
|
94
106
|
vled.B = 0.5e5
|
|
95
107
|
sim.scenario.addVLed(vled)
|
|
96
|
-
vled = VLed(
|
|
108
|
+
vled = VLed(7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
97
109
|
vled.sliceTime = 0.2
|
|
98
110
|
vled.slicesInFrame = 10
|
|
99
111
|
vled.B = 0.5e5
|
|
@@ -108,11 +120,11 @@ if __name__ == "__main__":
|
|
|
108
120
|
|
|
109
121
|
# setting algorithm and number of connections
|
|
110
122
|
sim.set_allocation_algorithm(alloc)
|
|
111
|
-
sim.goalConnections =
|
|
123
|
+
sim.goalConnections = 60
|
|
112
124
|
|
|
113
125
|
# changing Dynamic
|
|
114
126
|
sim.lambdaS = 1
|
|
115
|
-
sim.mu =
|
|
127
|
+
sim.mu = 30
|
|
116
128
|
|
|
117
129
|
# changing random wait limits
|
|
118
130
|
|
|
@@ -125,9 +137,3 @@ if __name__ == "__main__":
|
|
|
125
137
|
# initialize and run
|
|
126
138
|
sim.init()
|
|
127
139
|
sim.run()
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
|
|
@@ -10,7 +10,7 @@ long_description = (this_directory / "README.md").read_text()
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name="vlcSim",
|
|
13
|
-
version="0.2.
|
|
13
|
+
version="0.2.6",
|
|
14
14
|
license="MIT",
|
|
15
15
|
description="Python Package of Event-Oriented Simulation for visible light communication",
|
|
16
16
|
author="Danilo Bórquez-Paredes",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vlcSim
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Python Package of Event-Oriented Simulation for visible light communication
|
|
5
5
|
Home-page: https://gitlab.com/DaniloBorquez/simvlc/
|
|
6
6
|
Author: Danilo Bórquez-Paredes
|
|
@@ -45,17 +45,28 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
45
45
|
for vled in vleds:
|
|
46
46
|
capacities.append(scenario.capacityVled(receiver, vled))
|
|
47
47
|
posBestCapacity = capacities.index(max(capacities))
|
|
48
|
-
|
|
48
|
+
numberOfSlices = 0
|
|
49
|
+
if (
|
|
50
|
+
controller.numberOfActiveConnections(vleds[posBestCapacity]) > 5
|
|
51
|
+
or capacities[posBestCapacity] == 0
|
|
52
|
+
):
|
|
49
53
|
connection.AP = scenario.rfs[0]
|
|
54
|
+
connection.receiver.capacityFromAP = scenario.capacityRf(
|
|
55
|
+
receiver, connection.AP
|
|
56
|
+
)
|
|
57
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
58
|
+
connection.capacityRequired, connection.receiver.capacityFromAP
|
|
59
|
+
)
|
|
50
60
|
else:
|
|
51
61
|
connection.AP = vleds[posBestCapacity]
|
|
62
|
+
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
63
|
+
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
64
|
+
connection.capacityRequired, capacities[posBestCapacity]
|
|
65
|
+
)
|
|
52
66
|
|
|
53
|
-
numberOfSlices = connection.numberOfSlicesNeeded(
|
|
54
|
-
connection.capacityRequired, capacities[posBestCapacity]
|
|
55
|
-
)
|
|
56
|
-
connection.receiver.capacityFromAP = capacities[posBestCapacity]
|
|
57
67
|
actualSlice = connection.nextSliceInAPWhenArriving(connection.AP)
|
|
58
68
|
aux = 0
|
|
69
|
+
auxFrame = 0
|
|
59
70
|
|
|
60
71
|
# Actual frame
|
|
61
72
|
for slice in range(actualSlice, connection.AP.slicesInFrame):
|
|
@@ -73,12 +84,13 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
73
84
|
if controller.framesState(connection.AP)[frameIndex][slice] == False:
|
|
74
85
|
connection.assignFrameSlice(frameIndex, slice)
|
|
75
86
|
aux += 1
|
|
87
|
+
auxFrame = frameIndex
|
|
76
88
|
break
|
|
77
89
|
|
|
78
90
|
if aux == numberOfSlices:
|
|
79
91
|
break
|
|
80
92
|
|
|
81
|
-
frameIndex =
|
|
93
|
+
frameIndex = auxFrame + 1
|
|
82
94
|
while aux < numberOfSlices:
|
|
83
95
|
connection.assignFrameSlice(frameIndex, 0)
|
|
84
96
|
frameIndex += 1
|
|
@@ -89,25 +101,25 @@ def alloc(receiver, connection: Connection, scenario: Scenario, controller: Cont
|
|
|
89
101
|
if __name__ == "__main__":
|
|
90
102
|
# Simulator Constructor: size of the room, with the numbrer of grids and the rho parameter
|
|
91
103
|
|
|
92
|
-
sim = Simulator(
|
|
104
|
+
sim = Simulator(20.0, 20.0, 2.15, 10, 0.8)
|
|
93
105
|
|
|
94
106
|
# Adding Vleds to the room
|
|
95
|
-
vled = VLed(-
|
|
107
|
+
vled = VLed(-7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
96
108
|
vled.sliceTime = 0.2
|
|
97
109
|
vled.slicesInFrame = 10
|
|
98
110
|
vled.B = 0.5e5
|
|
99
111
|
sim.scenario.addVLed(vled)
|
|
100
|
-
vled = VLed(-
|
|
112
|
+
vled = VLed(-7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
101
113
|
vled.sliceTime = 0.2
|
|
102
114
|
vled.slicesInFrame = 10
|
|
103
115
|
vled.B = 0.5e5
|
|
104
116
|
sim.scenario.addVLed(vled)
|
|
105
|
-
vled = VLed(
|
|
117
|
+
vled = VLed(7.5, -7.5, 2.15, 60, 60, 20, 70)
|
|
106
118
|
vled.sliceTime = 0.2
|
|
107
119
|
vled.slicesInFrame = 10
|
|
108
120
|
vled.B = 0.5e5
|
|
109
121
|
sim.scenario.addVLed(vled)
|
|
110
|
-
vled = VLed(
|
|
122
|
+
vled = VLed(7.5, 7.5, 2.15, 60, 60, 20, 70)
|
|
111
123
|
vled.sliceTime = 0.2
|
|
112
124
|
vled.slicesInFrame = 10
|
|
113
125
|
vled.B = 0.5e5
|
|
@@ -122,11 +134,11 @@ if __name__ == "__main__":
|
|
|
122
134
|
|
|
123
135
|
# setting algorithm and number of connections
|
|
124
136
|
sim.set_allocation_algorithm(alloc)
|
|
125
|
-
sim.goalConnections =
|
|
137
|
+
sim.goalConnections = 60
|
|
126
138
|
|
|
127
139
|
# changing Dynamic
|
|
128
140
|
sim.lambdaS = 1
|
|
129
|
-
sim.mu =
|
|
141
|
+
sim.mu = 30
|
|
130
142
|
|
|
131
143
|
# changing random wait limits
|
|
132
144
|
|
|
@@ -139,9 +151,3 @@ if __name__ == "__main__":
|
|
|
139
151
|
# initialize and run
|
|
140
152
|
sim.init()
|
|
141
153
|
sim.run()
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
@@ -250,6 +250,7 @@ class Controller:
|
|
|
250
250
|
|
|
251
251
|
if self.__allocationStatus == Controller.status.ALLOCATED:
|
|
252
252
|
index = self.APPosition(connection.AP)
|
|
253
|
+
self.__numberActiveConnections[index] += 1
|
|
253
254
|
actualSlice = connection.nextSliceInAPWhenArriving(connection.AP) - 1
|
|
254
255
|
actualTime = (
|
|
255
256
|
(time // (connection.AP.slicesInFrame * connection.AP.sliceTime))
|
|
@@ -276,7 +277,6 @@ class Controller:
|
|
|
276
277
|
* (fs[0] + auxPreviousTime)
|
|
277
278
|
+ fs[1] * connection.AP.sliceTime
|
|
278
279
|
)
|
|
279
|
-
|
|
280
280
|
time = connection.getNextTime()
|
|
281
281
|
return Controller.nextStatus.RESUME, time, connection
|
|
282
282
|
elif self.__allocationStatus == Controller.status.NOT_ALLOCATED:
|
|
@@ -303,12 +303,13 @@ class Controller:
|
|
|
303
303
|
flag = False
|
|
304
304
|
for i in range(nextSlice, connection.AP.slicesInFrame):
|
|
305
305
|
if len(self.__activeConnections[index]) == 0:
|
|
306
|
+
flag = True
|
|
306
307
|
break
|
|
307
308
|
if self.__activeConnections[index][0][i] != False:
|
|
308
309
|
flag = True
|
|
309
310
|
break
|
|
310
311
|
if not flag:
|
|
311
|
-
self.__activeConnections[index].pop(
|
|
312
|
+
self.__activeConnections[index].pop(0)
|
|
312
313
|
return Controller.nextStatus.RESUME, timeNext, connection
|
|
313
314
|
|
|
314
315
|
def resumeConnection(self, connection, time):
|
|
@@ -357,6 +358,7 @@ class Controller:
|
|
|
357
358
|
flag = True
|
|
358
359
|
if flag:
|
|
359
360
|
self.__activeConnections[index].pop(self.__activeConnection[index])
|
|
361
|
+
self.__numberActiveConnections[index] -= 1
|
|
360
362
|
return Controller.nextStatus.IDLE, time, None
|
|
361
363
|
|
|
362
364
|
def init(self):
|
|
@@ -364,12 +366,14 @@ class Controller:
|
|
|
364
366
|
Initializatrion of this controller. This methods must be invoked before to start the simulation.
|
|
365
367
|
"""
|
|
366
368
|
self.__activeConnections = []
|
|
369
|
+
self.__numberActiveConnections = []
|
|
367
370
|
|
|
368
371
|
nvleds = 0
|
|
369
372
|
nrfs = 0
|
|
370
373
|
actual = None
|
|
371
374
|
|
|
372
375
|
for i in range(len(self.__scenario.vleds) + len(self.__scenario.rfs)):
|
|
376
|
+
self.__numberActiveConnections.append(0)
|
|
373
377
|
self.__activeConnections.append([])
|
|
374
378
|
if (
|
|
375
379
|
len(self.__scenario.vleds) > nvleds
|
|
@@ -411,7 +415,7 @@ class Controller:
|
|
|
411
415
|
|
|
412
416
|
return self.__activeConnections
|
|
413
417
|
|
|
414
|
-
def numberOfActiveConnections(self,
|
|
418
|
+
def numberOfActiveConnections(self, ap: int):
|
|
415
419
|
"""
|
|
416
420
|
The number of active connections in this AP.
|
|
417
421
|
|
|
@@ -420,7 +424,7 @@ class Controller:
|
|
|
420
424
|
:return: The number of active connections in this AP.
|
|
421
425
|
:rtype: int
|
|
422
426
|
"""
|
|
423
|
-
return
|
|
427
|
+
return self.__numberActiveConnections[self.APPosition(ap)]
|
|
424
428
|
|
|
425
429
|
def assignSlice(self, apIndex, frame, slice, connection):
|
|
426
430
|
numberOfFrames = len(self.__activeConnections[apIndex])
|
|
@@ -51,6 +51,12 @@ class AccessPoint:
|
|
|
51
51
|
|
|
52
52
|
@property
|
|
53
53
|
def B(self) -> float:
|
|
54
|
+
"""
|
|
55
|
+
Gets the Bandwith of this AccessPoint
|
|
56
|
+
|
|
57
|
+
:return: The B of this AccessPoint
|
|
58
|
+
:rtype: float
|
|
59
|
+
"""
|
|
54
60
|
return self._B
|
|
55
61
|
|
|
56
62
|
@B.setter
|
|
@@ -164,6 +170,12 @@ class AccessPoint:
|
|
|
164
170
|
|
|
165
171
|
@property
|
|
166
172
|
def slicesInFrame(self) -> int:
|
|
173
|
+
"""
|
|
174
|
+
The number of slices in the frame. This is used to determine how many slices will be in the frame.
|
|
175
|
+
|
|
176
|
+
:return: The number of slices in the frame
|
|
177
|
+
:rtype: int
|
|
178
|
+
"""
|
|
167
179
|
return self._slicesInFrame
|
|
168
180
|
|
|
169
181
|
@slicesInFrame.setter
|
|
@@ -177,6 +189,9 @@ class VLed(AccessPoint):
|
|
|
177
189
|
"""
|
|
178
190
|
|
|
179
191
|
numberOfVLeds = 0
|
|
192
|
+
"""
|
|
193
|
+
number of VLeds created
|
|
194
|
+
"""
|
|
180
195
|
|
|
181
196
|
def __init__(
|
|
182
197
|
self,
|
|
@@ -318,7 +333,14 @@ class VLed(AccessPoint):
|
|
|
318
333
|
|
|
319
334
|
|
|
320
335
|
class RF(AccessPoint):
|
|
336
|
+
"""
|
|
337
|
+
Class that represents a RF object
|
|
338
|
+
"""
|
|
339
|
+
|
|
321
340
|
numberOfRFs = 0
|
|
341
|
+
"""
|
|
342
|
+
Number of RFs created
|
|
343
|
+
"""
|
|
322
344
|
|
|
323
345
|
def __init__(
|
|
324
346
|
self,
|
|
@@ -353,6 +375,12 @@ class RF(AccessPoint):
|
|
|
353
375
|
|
|
354
376
|
@property
|
|
355
377
|
def bf(self) -> float:
|
|
378
|
+
"""
|
|
379
|
+
femtocell bandwidth
|
|
380
|
+
|
|
381
|
+
:return: Value of BF property
|
|
382
|
+
:rtype: float
|
|
383
|
+
"""
|
|
356
384
|
return self.__bf
|
|
357
385
|
|
|
358
386
|
@bf.setter
|
|
@@ -361,6 +389,13 @@ class RF(AccessPoint):
|
|
|
361
389
|
|
|
362
390
|
@property
|
|
363
391
|
def pf(self) -> float:
|
|
392
|
+
"""
|
|
393
|
+
Femtobase power transmission
|
|
394
|
+
|
|
395
|
+
:return: Femtobase power transmission
|
|
396
|
+
:rtype: float
|
|
397
|
+
|
|
398
|
+
"""
|
|
364
399
|
return self.__pf
|
|
365
400
|
|
|
366
401
|
@pf.setter
|
|
@@ -369,6 +404,12 @@ class RF(AccessPoint):
|
|
|
369
404
|
|
|
370
405
|
@property
|
|
371
406
|
def BERf(self) -> float:
|
|
407
|
+
"""
|
|
408
|
+
BER desired in femto network
|
|
409
|
+
|
|
410
|
+
:return: BER
|
|
411
|
+
:rtype: float
|
|
412
|
+
"""
|
|
372
413
|
return self.__BERf
|
|
373
414
|
|
|
374
415
|
@BERf.setter
|
|
@@ -377,6 +418,12 @@ class RF(AccessPoint):
|
|
|
377
418
|
|
|
378
419
|
@property
|
|
379
420
|
def Af(self) -> float:
|
|
421
|
+
"""
|
|
422
|
+
Pathloss constant
|
|
423
|
+
|
|
424
|
+
:return: Pathloss constant
|
|
425
|
+
:rtype: float
|
|
426
|
+
"""
|
|
380
427
|
return self.__Af
|
|
381
428
|
|
|
382
429
|
@Af.setter
|
|
@@ -385,6 +432,12 @@ class RF(AccessPoint):
|
|
|
385
432
|
|
|
386
433
|
@property
|
|
387
434
|
def Ef(self) -> float:
|
|
435
|
+
"""
|
|
436
|
+
Pathloss exponent
|
|
437
|
+
|
|
438
|
+
:return: Pathloss exponent
|
|
439
|
+
:rtype: float
|
|
440
|
+
"""
|
|
388
441
|
return self.__Ef
|
|
389
442
|
|
|
390
443
|
@Ef.setter
|
|
@@ -393,6 +446,12 @@ class RF(AccessPoint):
|
|
|
393
446
|
|
|
394
447
|
@property
|
|
395
448
|
def R_awgn(self) -> float:
|
|
449
|
+
"""
|
|
450
|
+
Normalized AWGN noise power
|
|
451
|
+
|
|
452
|
+
:return: Normalized AWGN noise power
|
|
453
|
+
:rtype: float
|
|
454
|
+
"""
|
|
396
455
|
return self.__R_awgn
|
|
397
456
|
|
|
398
457
|
@R_awgn.setter
|
|
@@ -409,6 +468,12 @@ class RF(AccessPoint):
|
|
|
409
468
|
|
|
410
469
|
@property
|
|
411
470
|
def N_rf(self) -> int:
|
|
471
|
+
"""
|
|
472
|
+
Number of cells using this femtocell
|
|
473
|
+
|
|
474
|
+
:return: Number of cells using this femtocell
|
|
475
|
+
:rtype: int
|
|
476
|
+
"""
|
|
412
477
|
return self.__N_rf
|
|
413
478
|
|
|
414
479
|
@N_rf.setter
|
|
@@ -458,6 +523,30 @@ class Receiver:
|
|
|
458
523
|
i1: float = 0.562,
|
|
459
524
|
i2: float = 0.0868,
|
|
460
525
|
) -> None:
|
|
526
|
+
"""
|
|
527
|
+
Initializes the object with the values. This is the constructor for the Schrodinger model
|
|
528
|
+
|
|
529
|
+
:param x: x coordinate of the object
|
|
530
|
+
:param y: y coordinate of the object's coordinate.
|
|
531
|
+
:param z: z coordinate of the object's coordinate.
|
|
532
|
+
:param aDet: aDet value of the object's coordinate.
|
|
533
|
+
:param ts: time of the object's coordinate. Default is 10 seconds.
|
|
534
|
+
:param index
|
|
535
|
+
:param fov: q of the object. Default is 1. 6e - 19.
|
|
536
|
+
:param q
|
|
537
|
+
:param s: ibg b - parameter of the Ib - Galactic model. Default i 5 seconds.
|
|
538
|
+
:param b: c b - parameter of the Ib - Galactic model. Default is 5 seconds.
|
|
539
|
+
:param ibg
|
|
540
|
+
:param cb
|
|
541
|
+
:param tk
|
|
542
|
+
:param a: n n - prameter of the B - parameter. Default is 10 seconds.
|
|
543
|
+
:param gv
|
|
544
|
+
:param n
|
|
545
|
+
:param fr
|
|
546
|
+
:param gm
|
|
547
|
+
:param i1
|
|
548
|
+
:param i2
|
|
549
|
+
"""
|
|
461
550
|
self.__x = x
|
|
462
551
|
self.__y = y
|
|
463
552
|
self.__z = z
|
|
@@ -492,6 +581,12 @@ class Receiver:
|
|
|
492
581
|
|
|
493
582
|
@property
|
|
494
583
|
def capacityFromAP(self):
|
|
584
|
+
"""
|
|
585
|
+
Get the capacity from AP.
|
|
586
|
+
|
|
587
|
+
:return: capacity from AP
|
|
588
|
+
:rtype: float
|
|
589
|
+
"""
|
|
495
590
|
return self.__capacityFromAP
|
|
496
591
|
|
|
497
592
|
@capacityFromAP.setter
|
|
@@ -500,6 +595,12 @@ class Receiver:
|
|
|
500
595
|
|
|
501
596
|
@property
|
|
502
597
|
def ID(self) -> int:
|
|
598
|
+
"""
|
|
599
|
+
Return the ID of the object. This is used to distinguish between different objects that are part of the same object group.
|
|
600
|
+
|
|
601
|
+
:return: The ID of the object
|
|
602
|
+
:rtype: int
|
|
603
|
+
"""
|
|
503
604
|
return self.__ID
|
|
504
605
|
|
|
505
606
|
@ID.setter
|
|
@@ -508,6 +609,12 @@ class Receiver:
|
|
|
508
609
|
|
|
509
610
|
@property
|
|
510
611
|
def x(self) -> float:
|
|
612
|
+
"""
|
|
613
|
+
Get the x coordinate.
|
|
614
|
+
|
|
615
|
+
:return: The x coordinate
|
|
616
|
+
:rtype: float
|
|
617
|
+
"""
|
|
511
618
|
return self.__x
|
|
512
619
|
|
|
513
620
|
@x.setter
|
|
@@ -516,6 +623,12 @@ class Receiver:
|
|
|
516
623
|
|
|
517
624
|
@property
|
|
518
625
|
def y(self) -> float:
|
|
626
|
+
"""
|
|
627
|
+
Gets the y coordinate .
|
|
628
|
+
|
|
629
|
+
:return: The y coordinate
|
|
630
|
+
:rtype: float
|
|
631
|
+
"""
|
|
519
632
|
return self.__y
|
|
520
633
|
|
|
521
634
|
@y.setter
|
|
@@ -524,6 +637,12 @@ class Receiver:
|
|
|
524
637
|
|
|
525
638
|
@property
|
|
526
639
|
def z(self) -> float:
|
|
640
|
+
"""
|
|
641
|
+
Z coordinate .
|
|
642
|
+
|
|
643
|
+
:return: the z coordinate
|
|
644
|
+
:rtype: float
|
|
645
|
+
"""
|
|
527
646
|
return self.__z
|
|
528
647
|
|
|
529
648
|
@z.setter
|
|
@@ -568,6 +687,12 @@ class Receiver:
|
|
|
568
687
|
|
|
569
688
|
@property
|
|
570
689
|
def position(self):
|
|
690
|
+
"""
|
|
691
|
+
Return the position of the object. This is a tuple of ( x y z)
|
|
692
|
+
|
|
693
|
+
:return: the position of the object
|
|
694
|
+
:rtype: tuple
|
|
695
|
+
"""
|
|
571
696
|
return self.__position
|
|
572
697
|
|
|
573
698
|
@property
|
|
@@ -944,4 +1069,4 @@ class Scenario:
|
|
|
944
1069
|
return vled.B * m.log2(1 + self.snrVled(receiver, vled))
|
|
945
1070
|
|
|
946
1071
|
def capacityRf(self, receiver: Receiver, rf: RF) -> float:
|
|
947
|
-
return rf.B * m.log2(1 + self.
|
|
1072
|
+
return rf.B * m.log2(1 + self.snrRf(receiver, rf))
|
|
@@ -306,11 +306,7 @@ class Simulator:
|
|
|
306
306
|
text += (
|
|
307
307
|
" VLed: {:>5}".format(event.connection.AP.ID)
|
|
308
308
|
+ " ({:^5})".format(
|
|
309
|
-
|
|
310
|
-
self.__controller.activeConnections[
|
|
311
|
-
self.__controller.APPosition(event.connection.AP)
|
|
312
|
-
]
|
|
313
|
-
)
|
|
309
|
+
self.__controller.numberOfActiveConnections(event.connection.AP)
|
|
314
310
|
)
|
|
315
311
|
+ " |"
|
|
316
312
|
)
|
|
@@ -318,11 +314,7 @@ class Simulator:
|
|
|
318
314
|
text += (
|
|
319
315
|
" RF: {:>5}".format(event.connection.AP.ID)
|
|
320
316
|
+ " ({:^5})".format(
|
|
321
|
-
|
|
322
|
-
self.__controller.activeConnections[
|
|
323
|
-
self.__controller.APPosition(event.connection.AP)
|
|
324
|
-
]
|
|
325
|
-
)
|
|
317
|
+
self.__controller.numberOfActiveConnections(event.connection.AP)
|
|
326
318
|
)
|
|
327
319
|
+ " |"
|
|
328
320
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|