How kaydo214/mec works
This repository is a Python simulation for learning mobile-task offloading policies and comparing tabular Q-learning with DQN. The principal workflow generates tasks and MEC conditions, represents them as state, selects Local/Edge/Cloud execution, computes costs and battery effects, and learns from repeated episodes before evaluating policy metrics. The two implementations are standalone entry points sharing the MEC environment: MEC.py contains the tabular baseline, while DQN.py adds neural value estimation and replay-based training. The map follows the README and excerpts; relationships for unsampled code are included only where documented.
Main entry points: DQN.py DQN training · MEC.py Q-learning training
Components 17
MEC Simulation
- Task and conditions
MEC.py - State encoding
MEC.py - Offload execution
MEC.py - Reward and battery
MEC.py
Tabular Q-Learning
- MEC entry point
MEC.py - Q-table agent
MEC.py
Deep Q-Network
- DQN entry point
DQN.py - DQN agent
DQN.py - Policy network
DQN.py - Target network
DQN.py - Replay memory
DQN.py
Training And Evaluation
- Q-learning training
MEC.py - DQN training
DQN.py - Policy evaluation
MEC.py - DQN evaluation
DQN.py - Metrics and plots
DQN.py
Other components
- Experiment runner
Connections 23
- Experiment runner → MEC entry point: runs baseline
README.md - Experiment runner → DQN entry point: runs DQN
README.md - MEC entry point → Q-learning training: starts training
MEC.py - DQN entry point → DQN training: starts training
DQN.py - Q-learning training → Task and conditions: resets episode
MEC.py - Q-learning training → Q-table agent: selects and updates
MEC.py - Q-learning training → Offload execution: steps environment
MEC.py - DQN training → Task and conditions: resets episode
README.md - DQN training → DQN agent: selects actions
DQN.py - DQN training → Offload execution: steps environment
DQN.py - DQN training → Replay memory: stores transitions
DQN.py - DQN agent → Policy network: predicts values
DQN.py - DQN agent → Target network: computes targets
DQN.py - DQN agent → Replay memory: samples batches
DQN.py - Task and conditions → State encoding: encodes features
README.md - State encoding → Q-table agent: provides state
MEC.py - State encoding → DQN agent: provides state
README.md - Offload execution → Reward and battery: calculates costs
MEC.py - Reward and battery → Task and conditions: prepares next task
MEC.py - MEC entry point → Policy evaluation: evaluates policy
MEC.py - DQN entry point → DQN evaluation: evaluates policy
DQN.py - Policy evaluation → Metrics and plots: reports metrics
README.md - DQN evaluation → Metrics and plots: reports metrics
DQN.py