Skip to content

Latest commit

 

History

History
92 lines (75 loc) · 3.24 KB

README.md

File metadata and controls

92 lines (75 loc) · 3.24 KB

format Pypi

About Amgu

The majority of paper in the subject of DRL & traffic mannagment don't share thier code or the data they used for train. There is an need to organize & create uniforms between paper &code a like. Amgu try to execly do that, creating abstract classes that can be hierarchical from and be easy to use and prevent cooled start. Traffic Managment System (including agent) has been created using thoes classes.Amgu-Traffic enable developer to use easy API with custom & premade model and envierments & Attacks on thoes.

Built With

Amgu has been built using, the following:

Getting Started

To use this project you'll need to have CityFlow already install inside your pip enviorment. In Addition ray should be installed custom to your machine(x86/x64).

Installation

Bellow example show the step to install and run example of Amgu.

  1. Install Amgu Traffic using Pypi.
       pip install Amgu/.
  2. Use in your code.
       from Amgu.basic.env import CityFlow1D
       from Amgu.basic.reward import *
       from Amgu.runnner import stable_baseline_train
       from stable_baselines3 import DQN
    
       exp_name = "DQN_delta_waiting_time_1x1"
       stable_baselines_config = {
           "experiment_name": exp_name,
           "env_config": {
               "config_path": "example/1x1/config.json",
               "steps_per_episode": 400,
               "save_path": "example/1x1/res/",
           },
           "env_param": {"reward_func": queue_length, "district": True},
           "policy_param": {
               "policy": "MlpPolicy",
               "tensorboard_log": f"{exp_name}/tesnorboard",
               'policy_kwargs': dict(activation_fn=th.nn.ReLU, net_arch=[146,50,8]),
               "gamma": 0.95,
               "learning_rate": 0.005,
               "exploration_initial_eps": 1,
               'exploration_fraction': 0.9,
               "exploration_final_eps": 0.15,
               'target_update_interval': 1_000,
           },
           "evaluation_interval": 400,
           "evaluation_duration": 1,
           "stop": {"training_iteration": 2_000},
       }
       stable_baseline_train(DQN, CityFlow1D, stable_baselines_config)

Roadmap

  • Abstract Class.
  • Traffic Class (using cityflow).
  • Add Documntation.
  • Build Test

See the open issues for a full list of proposed features (and known issues).

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)