VLCsim - Visible Light Communication Simulator
VLCsim is a Python-based discrete-event simulation framework for modeling and analyzing Visible Light Communication (VLC) networks with hybrid VLC/RF support and Time Division Multiplexing (TDM).
Overview
VLCsim provides a comprehensive framework for simulating dynamic VLC environments with:
✅ Event-Driven Architecture: Efficient discrete-event simulation engine
✅ Hybrid Communication: VLC with RF fallback support
✅ Built-in Algorithms: Default resource allocation algorithm included
✅ Flexible Customization: Implement custom allocation strategies
✅ TDM Management: Time-Division Multiplexing with configurable slices
✅ Performance Metrics: Built-in SNR, capacity, and blocking probability calculations
✅ Research-Ready: Designed for VLC network research and experimentation
Key Features
Dynamic Environment
Simulate real-time connections with arrivals, departures, pauses, and retries. Configure traffic patterns using Poisson arrivals and exponential service times.
Resource Allocation
Built-in Default Algorithm: Works out-of-the-box with SNR-based VLed selection and RF fallback.
Custom Algorithms: Implement your own allocation strategies for research or specific requirements.
Scenario Building
Create complex VLC scenarios with:
Multiple VLed access points with configurable power and beam angles
RF access points for seamless fallback
Flexible room dimensions and wall reflection parameters
Mobile receivers with photodetector specifications
Quick Example
Get started with just a few lines of code:
from vlcsim import Simulator, VLed, RF
# Create simulator
sim = Simulator(10.0, 10.0, 3.0, 20, 0.8)
# Add access points
vled = VLed(5.0, 5.0, 3.0, 2, 2, 20, 60)
vled.sliceTime = 0.1
vled.slicesInFrame = 10
sim.scenario.addVLed(vled)
rf = RF(5.0, 5.0, 1.0)
rf.sliceTime = 0.1
rf.slicesInFrame = 10
sim.scenario.addRF(rf)
# Run simulation with default algorithm
sim.lambdaS = 3
sim.mu = 10
sim.goalConnections = 1000
sim.init()
sim.run()
print(f"Blocking Probability: {sim.get_Blocking_Probability()}")
Installation
Install via PyPI:
$ pip install vlcSim
Or with Poetry:
$ poetry add vlcSim
Learning Resources
VLCSim includes comprehensive examples to help you get started:
- Basic Example (
examples/basic_example.py) Minimal workflow with default algorithm, 4 VLEDs, and 1 RF access point. Perfect for understanding the core simulation process.
- Advanced Example (
examples/advanced_example.py) Custom SNR-based allocation algorithm with heterogeneous device configurations. Demonstrates advanced features and metrics collection.
- Interactive Notebook (
examples/vlc_simulation_example.ipynb) Step-by-step Jupyter tutorial with detailed explanations. Includes custom load balancing and TDM resource allocation. Best for hands-on learning in Jupyter or Google Colab.
See Getting Started for detailed information about each example.
Who Should Use VLCsim?
VLCsim is designed for:
Researchers studying VLC network performance and resource allocation
Students learning about optical wireless communications
Engineers prototyping VLC system designs
Academics developing new allocation algorithms
Documentation Structure
User Guide
Reference
Project Links
PyPI Package: https://pypi.org/project/vlcSim/
GitLab Repository: https://gitlab.com/DaniloBorquez/simvlc
Issue Tracker: https://gitlab.com/DaniloBorquez/simvlc/-/issues
License
VLCsim is released under the MIT License. See the LICENSE file for details.
Note
This project is under active development. Features and APIs may change. Check the CHANGELOG for recent updates.