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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vlcSim
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: Python Package of Event-Oriented Simulation for visible light communication
5
5
  License: MIT
6
6
  License-File: LICENSE.md
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "vlcSim"
3
- version = "0.5.2" # Placeholder, will be replaced by dynamic versioning
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.5.2" # placeholder for poetry-dynamic-versioning
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 the class variable for this new scenario instance
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 duration.
1100
+ """Get the total execution time of the simulation.
1092
1101
 
1093
1102
  Returns:
1094
- float: Total simulated time in seconds (0.0 if not available)
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