MARL Spectrum Sharing in Vehicular Networks

repository·master·Indexed 42 days ago

https://github.com/le-liang/marlspectrumsharingv2x

Implementation of spectrum sharing in vehicular networks using multi-agent reinforcement learning (MARL) and single-agent RL (SARL). Includes training scripts, testing environments, and tools to reproduce research results from the paper 'Spectrum sharing in vehicular networks based on multi-agent reinforcement learning'. Requires Python 3.6 and TensorFlow 1.12.0.

Tokens
505
Snippets
3
Records
4
Agent score
5%

What's inside marlspectrumsharingv2x

  1. Train the Single-Agent Reinforcement Learning (SARL) benchmark model

    master

    To train the single-agent RL benchmark model, use the SARL training script with the environment and replay memory modules.

    Required files:

    • main_sarl_train.py
    • Environment_marl.py
    • replay_memory.py
    # Run the SARL training script
    python main_sarl_train.py
  2. Test trained models and reproduce paper results

    master

    To evaluate trained models in a testing environment, use the testing suite. This setup allows you to reproduce Figures 3 and 4 from the original paper.

    Requirements:

    • Files: main_test.py, Environment_marl_test.py, replay_memory.py
    • Model directory: A folder named /model containing the trained weights.

    Customization: To change the V2V payload size, modify the self.demand_size attribute within Environment_marl_test.py.

    Note: Avoid using the "Test" mode within main_marl_train.py as it is not recommended.

    # Run the testing script
    python main_test.py
  3. Reproduce figures from the research paper

    master

    The repository provides specific paths to reproduce results from the paper "Spectrum sharing in vehicular networks based on multi-agent reinforcement learning":

    • Figures 3 and 4: Run main_test.py. You can adjust the V2V payload size by modifying self.demand_size in Environment_marl_test.py.
    • Figure 5: This figure must be generated by recording the returns (performance metrics) during the training phase.
    • Figures 6-7: These figures represent the performance of arbitrary episodes (typically showing successful MARL transmission vs. failed random baselines) and can be observed during testing.
  4. Train the Multi-Agent Reinforcement Learning (MARL) model

    master

    To train the MARL model, you need to run the training script alongside the environment and replay memory modules. Ensure you have the required dependencies (Python 3.6 and TensorFlow 1.12.0) installed.

    Required files:

    • main_marl_train.py
    • Environment_marl.py
    • replay_memory.py
    # Run the MARL training script
    python main_marl_train.py