vlcsim.scene.AccessPoint
- class vlcsim.scene.AccessPoint(x: float, y: float, z: float)[source]
Bases:
objectBase class for all communication access points in VLC simulation.
AccessPoint provides the foundational structure for both VLC (VLed) and RF communication access points. It manages spatial positioning, operational state, and time-division multiplexing (TDM) parameters.
The class implements a state machine where access points can be either IDLE or BUSY, and supports TDM frame slicing for resource allocation.
- stateap
Enumeration defining AP states (IDLE, BUSY)
- Type:
Enum
- Properties:
x (float): X-coordinate position in meters y (float): Y-coordinate position in meters z (float): Z-coordinate position in meters (typically height) position (ndarray): 3D position vector [x, y, z] state (stateap): Current operational state ID (int): Unique identifier for the access point B (float): Bandwidth in Hz sliceTime (float): Duration of each time slice in seconds slicesInFrame (int): Number of slices per TDM frame
Example
AccessPoint is typically not instantiated directly, but through subclasses
# Create VLed access point vled = VLed(x=5.0, y=5.0, z=3.0, nLedsX=2, nLedsY=2, ledPower=20, theta=60) vled.sliceTime = 0.1 # 100ms slices vled.slicesInFrame = 10 # 10 slices per frame # Create RF access point rf = RF(x=5.0, y=5.0, z=1.0) rf.B = 5e6 # 5 MHz bandwidth
Note
Position coordinates use a standard 3D Cartesian coordinate system
Z-coordinate typically represents height (e.g., ceiling height for LEDs)
Bandwidth B is used in capacity calculations
TDM parameters control resource allocation granularity
- __init__(x: float, y: float, z: float) None[source]
Initialize an AccessPoint at a given 3D position.
Creates a new access point with specified coordinates and default configuration. The access point is initialized in IDLE state with default TDM parameters.
- Parameters:
x – X-coordinate position in meters
y – Y-coordinate position in meters
z – Z-coordinate position in meters (typically height from ground)
Example
Typically called from subclass constructors:
class MyAccessPoint(AccessPoint): def __init__(self, x, y, z): super().__init__(x, y, z) # Add subclass-specific initialization
Note
Default bandwidth is set to 1 MHz
Default slice time is 0.1 seconds (100ms)
Default frame has 10 slices
Initial state is IDLE
Methods
__init__(x, y, z)Initialize an AccessPoint at a given 3D position.
setBUSY()Set this access point to BUSY state.
setIDLE()Set this access point to IDLE state.
Attributes
Get the bandwidth of this access point.
Get the unique identifier of this access point.
Get the 3D position vector of this access point.
Get the time duration of each TDM slice.
Get the number of time slices in each TDM frame.
Get the current operational state of this access point.
Get the X-coordinate of this access point.
Get the Y-coordinate of this access point.
Get the Z-coordinate of this access point.
- property B: float
Get the bandwidth of this access point.
- Returns:
Bandwidth in Hz (default: 1 MHz)
- Return type:
float
- property ID: int | None
Get the unique identifier of this access point.
- Returns:
Access point ID, None if not yet assigned
- Return type:
int or None
- property position: ndarray[Any, dtype[float64]]
Get the 3D position vector of this access point.
- Returns:
Position vector [x, y, z] in meters
- Return type:
ndarray
- setBUSY() None[source]
Set this access point to BUSY state.
Transitions the access point to BUSY, indicating it is actively serving connections.
- setIDLE() None[source]
Set this access point to IDLE state.
Transitions the access point to IDLE, indicating it is ready to accept new connections.
- property sliceTime: float
Get the time duration of each TDM slice.
The slice time determines how long each connection can use the access point in a single time slice.
- Returns:
Slice time duration in seconds (default: 0.1s)
- Return type:
float
- property slicesInFrame: int
Get the number of time slices in each TDM frame.
This determines the frame structure for time-division multiplexing. Total frame duration equals sliceTime * slicesInFrame.
- Returns:
Number of slices per frame (default: 10)
- Return type:
int
- property state: state
Get the current operational state of this access point.
- Returns:
Current state, either IDLE or BUSY
- Return type:
stateap
- stateap(value)
alias of
state
- property x: float
Get the X-coordinate of this access point.
- Returns:
X-coordinate in meters
- Return type:
float
- property y: float
Get the Y-coordinate of this access point.
- Returns:
Y-coordinate in meters
- Return type:
float
- property z: float
Get the Z-coordinate of this access point.
- Returns:
Z-coordinate in meters (typically height)
- Return type:
float