vlcSim 0.5.2__tar.gz → 0.6.0__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.5.2 → vlcsim-0.6.0}/PKG-INFO +1 -1
- {vlcsim-0.5.2 → vlcsim-0.6.0}/pyproject.toml +1 -1
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/__init__.py +1 -1
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/scenario.py +4 -1
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/simulator.py +16 -2
- {vlcsim-0.5.2 → vlcsim-0.6.0}/LICENSE.md +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/README.md +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/controller/__init__.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/controller/connection.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/controller/controller.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/__init__.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/access_point.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/receiver.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/rf.py +0 -0
- {vlcsim-0.5.2 → vlcsim-0.6.0}/vlcsim/scene/vled.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "vlcSim"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0" # Placeholder, will be replaced by dynamic versioning
|
|
4
4
|
description = "Python Package of Event-Oriented Simulation for visible light communication"
|
|
5
5
|
authors = ["Danilo Bórquez-Paredes <danilo.borquez.p@uai.cl>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -29,7 +29,7 @@ See Also:
|
|
|
29
29
|
For detailed documentation, visit the project repository or build the Sphinx docs.
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
|
-
__version__ = "0.
|
|
32
|
+
__version__ = "0.6.0" # placeholder for poetry-dynamic-versioning
|
|
33
33
|
|
|
34
34
|
from .scene import *
|
|
35
35
|
from .controller import *
|
|
@@ -58,8 +58,11 @@ class Scenario:
|
|
|
58
58
|
with Z extending from 0 (floor) to height (ceiling).
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
|
-
# Reset
|
|
61
|
+
# Reset all class variables for this new scenario instance
|
|
62
|
+
# This is essential for proper reinitialization in notebook environments
|
|
62
63
|
Scenario.numberOfAPs = 0
|
|
64
|
+
VLed.numberOfVLeds = 0
|
|
65
|
+
RF.numberOfRFs = 0
|
|
63
66
|
|
|
64
67
|
self.__length: float = length # x
|
|
65
68
|
self.__width: float = width # y
|
|
@@ -47,6 +47,7 @@ Note:
|
|
|
47
47
|
from .controller import *
|
|
48
48
|
from .scene import *
|
|
49
49
|
import numpy as np
|
|
50
|
+
import time
|
|
50
51
|
from enum import Enum
|
|
51
52
|
from typing import Optional, List, Any, Callable
|
|
52
53
|
|
|
@@ -1024,6 +1025,9 @@ class Simulator:
|
|
|
1024
1025
|
self.__random_wait_variable = np.random.default_rng(self.__seedZ)
|
|
1025
1026
|
self.__capacity_required_variable = np.random.default_rng(self.__seedZ)
|
|
1026
1027
|
|
|
1028
|
+
# Start execution time measurement
|
|
1029
|
+
self.__start_time = time.perf_counter()
|
|
1030
|
+
|
|
1027
1031
|
# Create first arrival event
|
|
1028
1032
|
self.__events.append(
|
|
1029
1033
|
Event(
|
|
@@ -1085,13 +1089,23 @@ class Simulator:
|
|
|
1085
1089
|
self.event_routine()
|
|
1086
1090
|
if self.__current_event:
|
|
1087
1091
|
self.print_row(self.__current_event)
|
|
1092
|
+
|
|
1093
|
+
# Calculate execution time
|
|
1094
|
+
end_time = time.perf_counter()
|
|
1095
|
+
self.__time_duration = end_time - self.__start_time
|
|
1096
|
+
|
|
1088
1097
|
self.aggregated_metrics()
|
|
1089
1098
|
|
|
1090
1099
|
def time_duration(self) -> float:
|
|
1091
|
-
"""Get the total simulation
|
|
1100
|
+
"""Get the total execution time of the simulation.
|
|
1092
1101
|
|
|
1093
1102
|
Returns:
|
|
1094
|
-
float:
|
|
1103
|
+
float: Execution time in seconds (0.0 if not available)
|
|
1104
|
+
|
|
1105
|
+
Note:
|
|
1106
|
+
This measures the real wall-clock time taken to run the simulation,
|
|
1107
|
+
not the simulated time. The measurement starts when init() is called
|
|
1108
|
+
and ends when run() completes.
|
|
1095
1109
|
"""
|
|
1096
1110
|
return self.__time_duration if self.__time_duration is not None else 0.0
|
|
1097
1111
|
|
|
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
|