How amuthavanmoorthi/latency-minimization works
Purpose and Entry Points
This is a research simulation for optimizing a multi-antenna active STAR-RIS wireless system serving URLLC mobile-edge-computing users. It compares baseline policies with a Deep Deterministic Policy Gradient (DDPG) agent and persists trained policies/reward traces.
Primary execution paths are main.py for experiment orchestration and agent/train_ddpg.py for DDPG training.
STAR-RIS URLLC-MEC Environment
env/star_ris_env.py is the central environment: it represents system state, accepts continuous control actions, evolves a wireless/MEC decision step, and returns reward/termination signals to the RL loop.
It composes:
• Channel and propagation modeling from env/channel.py.
• URLLC latency/reliability calculations from env/urllc_latency.py.
• Environment package boundary in env/__init__.py.
This is the main boundary between optimization agents and domain-specific communications modeling.
Wireless Channel and Latency Model
env/channel.py models the channel quantities needed to evaluate multi-antenna STAR-RIS actions. env/urllc_latency.py translates communication and computation outcomes into URLLC latency-related performance, which is likely a core part of the environment reward and constraint handling.
The conceptual system design and equations are documented alongside implementation in paper/main.tex, paper/system_model.drawio, and paper/Multi-antenna active STAR-RIS URLLC-MEC system.drawio.
RL Agent and Training Control Flow
agent/ddpg_rl.py implements the DDPG learning system, including the continuous-action policy and value-learning path. agent/train_ddpg.py drives repeated environment interaction:
1. Obtain an observation from the STAR-RIS environment.
2. Select a continuous RIS/resource-control action through the DDPG policy.
3. Step the environment and receive reward/next state.
4. Store experience and update actor/critic networks.
5. Save learned model artifacts and reward histories.
agent/__init__.py provides the agent package boundary.
Baseline Evaluation
agent/baselines.py contains non-RL comparison strategies. These policies use the same environment-facing interface as DDPG, enabling comparable evaluation under shared channel, latency, and reward calculations.
This establishes a clean experimental boundary: domain simulation in env/, optimization approaches in agent/, and orchestration in main.py.
Model and Result Artifacts
Pretrained policies are stored under results/, including DDPG policy artifacts for different STAR-RIS element/user configurations:
• results/ddpg_model_N32_K2/policy.pt
• results/ddpg_model_N32_K4/policy.pt
• results/ddpg_rl_N32_K4/actor.pt
Reward traces such as results/training_rewards_N32_K4.npy and results/ddpg_rl_rewards_N32_K4.npy support training comparison. results/plot_results.py is the reporting/visualization entry point for persisted NumPy outputs.
Runtime and External Dependencies
The repository is Python-based, with PyTorch serialized checkpoints (.pt) and NumPy result arrays (.npy), implying PyTorch and NumPy as material runtime dependencies. No deployment infrastructure, network service, database, or external API integration is represented in the repository tree; experiments execute as local simulation/training workloads.
Main entry points: train_ddpg.py DDPG training loop · star_ris_env.py Environment package · main.py Experiment runner · main.tex System model paper
Components 14
Experiment Control
- Experiment runner · Orchestrates simulation experiments and policy comparisons.
main.py
STAR-RIS Simulation
- Environment package · Maps actions to next state, reward, and termination signals.
env/star_ris_env.py - Channel model · Computes multi-antenna STAR-RIS channel quantities.
env/channel.py - URLLC latency model · Evaluates communication and computation latency/reliability.
env/urllc_latency.py
Optimization Methods
- DDPG training loop · Runs environment interaction, replay updates, and persistence.
agent/train_ddpg.py - DDPG learner · Continuous-action actor-critic policy and value learning.
agent/ddpg_rl.py - Baseline policies · Non-RL policies evaluated through the shared environment interface.
agent/baselines.py
Models & Results
- N32/K2 policy
results/ddpg_model_N32_K2/policy.pt - N32/K4 policy
results/ddpg_model_N32_K4/policy.pt - N32/K4 actor
results/ddpg_rl_N32_K4/actor.pt - Reward traces · Persisted training reward histories for comparisons.
results/training_rewards_N32_K4.npy - Results plotting · Visualizes persisted experiment outputs.
results/plot_results.py
System Design
- System model paper · Documents system design and equations.
paper/main.tex - System diagrams · STAR-RIS URLLC-MEC conceptual diagrams.
paper/system_model.drawio
Connections 15
- Experiment runner → DDPG training loop: runs training
- Experiment runner → Baseline policies: evaluates
- DDPG training loop → DDPG learner: selects and updates
- DDPG training loop → Environment package: reset / step
- Baseline policies → Environment package: shared action interface
- DDPG learner → Environment package: continuous actions
- Environment package → Channel model: propagation evaluation
- Environment package → URLLC latency model: reward and constraints
- DDPG training loop → N32/K2 policy: saves / loads
- DDPG training loop → N32/K4 policy: saves / loads
- DDPG training loop → N32/K4 actor: saves / loads
- DDPG training loop → Reward traces: writes rewards
- Results plotting → Reward traces: reads
- System model paper → System diagrams: documents design
- System model paper → Environment package: specifies model