{ "info": { "author": "Praveen Palanisamy", "author_email": "praveen.palanisamy@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "\n![MACAD-Gym learning environment 1](https://raw.githubusercontent.com/praveen-palanisamy/macad-gym/master/docs/images/macad-gym-urban_4way_intrx_2c1p1m.png)\n[MACAD-Gym](https://arxiv.org/abs/1911.04175) is a training platform for Multi-Agent Connected Autonomous\n Driving (MACAD) built on top of the CARLA Autonomous Driving simulator.\n\nMACAD-Gym provides OpenAI Gym-compatible learning environments for various\ndriving scenarios for training Deep RL algorithms in homogeneous/heterogenous,\ncommunicating/non-communicating and other multi-agent settings. New environments and scenarios\n can be easily added using a simple, JSON-like configuration.\n\n[![PyPI version fury.io](https://badge.fury.io/py/macad-gym.svg)](https://pypi.python.org/pypi/macad-gym/)\n[![PyPI format](https://img.shields.io/pypi/pyversions/macad-gym.svg)](https://pypi.python.org/pypi/macad-gym/)\n[![Downloads](https://pepy.tech/badge/macad-gym)](https://pepy.tech/project/macad-gym)\n### Quick Start\n\nInstall MACAD-Gym using `pip install macad-gym`.\n If you have CARLA installed, you can get going using the following 3 lines of code. If not, follow the\n[Getting started steps](#getting-started).\n\n```python\nimport gym\nimport macad_gym\nenv = gym.make(\"HomoNcomIndePOIntrxMASS3CTWN3-v0\")\n\n# Your agent code here\n```\n\n Any RL library that supports the OpenAI-Gym API can be used to train agents in MACAD-Gym. The [MACAD-Agents](https://github.com/praveen-palanisamy/macad-agents) repository provides sample agents as a starter.\n\n### Usage guide\n\n1. [Getting Started](#getting-started)\n1. [Learning platform & agent interface](#learning-platform-and-agent-interface)\n1. [Citing MACAD-Gym](#citing)\n1. [Developer Contribution Guide](CONTRIBUTING.md)\n\n### Getting Started\n\n> Assumes an Ubuntu (16.04/18.04 or later) system.\n\n1. Install the system requirements:\n\t- Miniconda/Anaconda 3.x\n\t\t- `wget -P ~ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; bash ~/Miniconda3-latest-Linux-x86_64.sh`\n\t- cmake (`sudo apt install cmake`)\n\t- zlib (`sudo apt install zlib1g-dev`)\n\t- [optional] ffmpeg (`sudo apt install ffmpeg`)\n\n1. Setup CARLA (0.9.x)\n\n 3.1 `mkdir ~/software && cd ~/software`\n\n 3.2 Example: Download the 0.9.4 release version from: [Here](https://drive.google.com/file/d/1p5qdXU4hVS2k5BOYSlEm7v7_ez3Et9bP/view)\n Extract it into `~/software/CARLA_0.9.4`\n\n 3.3 `echo \"export CARLA_SERVER=${HOME}/software/CARLA_0.9.4/CarlaUE4.sh\" >> ~/.bashrc`\n\n1. Install MACAD-Gym:\n - **Option1 for users** : `pip install macad-gym`\n - **Option2 for developers**:\n - Fork/Clone the repository to your workspace:\n `git clone https://github.com/praveen-palanisamy/macad-gym.git && cd macad-gym`\n - Create a new conda env named \"macad-gym\" and install the required packages:\n `conda env create -f conda_env.yml`\n - Activate the `macad-gym` conda python env:\n `source activate macad-gym`\n - Install the `macad-gym` package:\n\t `pip install -e .`\n - Install CARLA PythonAPI: `pip install carla==0.9.4`\n > NOTE: Change the carla client PyPI package version number to match with your CARLA server version\n\n\n### Learning Platform and Agent Interface\n\nThe MACAD-Gym platform provides learning environments for training agents in both,\nsingle-agent and multi-agent settings for various autonomous driving tasks and \nscenarios that enables training agents in homogeneous/heterogeneous\nThe learning environments follows naming convention for the ID to be consistent\nand to support versioned benchmarking of agent algorithms.\nThe naming convention is illustrated below with `HeteCommCoopPOUrbanMgoalMAUSID`\nas an example:\n![MACAD-Gym Naming Conventions](https://raw.githubusercontent.com/praveen-palanisamy/macad-gym/master/docs/images/macad-gym-naming-conventions.png)\n\nThe number of training environments in MACAD-Gym is expected to grow over time\n(PRs are very welcome!). \n\n#### Environments\n\nThe environment interface is simple and follows the widely adopted OpenAI-Gym\ninterface. You can create an instance of a learning environment using the \nfollowing 3 lines of code:\n\n```python\nimport gym\nimport macad_gym\nenv = gym.make(\"HomoNcomIndePOIntrxMASS3CTWN3-v0\")\n```\n\nLike any OpenAI Gym environment, you can obtain the observation space and action\nspaces as shown below:\n\n```bash\n>>> print(env.observation_space)\nDict(car1:Box(168, 168, 3), car2:Box(168, 168, 3), car3:Box(168, 168, 3))\n>>> print(env.action_space)\nDict(car1:Discrete(9), car2:Discrete(9), car3:Discrete(9))\n```\n\nTo get a list of available environments, you can use\nthe `list_available_envs()` function as shown in the code snippet below:\n\n```python\nimport gym\nimport macad_gym\nmacad_gym.list_available_envs()\n```\nThis will print the available environments. Sample output is provided below for reference:\n\n```bash\nEnvironment-ID: Short description\n{'HeteNcomIndePOIntrxMATLS1B2C1PTWN3-v0': 'Heterogeneous, Non-communicating, '\n 'Independent,Partially-Observable '\n 'Intersection Multi-Agent scenario '\n 'with Traffic-Light Signal, 1-Bike, '\n '2-Car,1-Pedestrian in Town3, '\n 'version 0',\n 'HomoNcomIndePOIntrxMASS3CTWN3-v0': 'Homogenous, Non-communicating, '\n 'Independed, Partially-Observable '\n 'Intersection Multi-Agent scenario with '\n 'Stop-Sign, 3 Cars in Town3, version 0'}\n```\n\n#### Agent interface\nThe Agent-Environment interface is compatible with the OpenAI-Gym interface\nthus, allowing for easy experimentation with existing RL agent algorithm \nimplementations and libraries. You can use any existing Deep RL library that supports the Open AI Gym API to train your agents.\n\nThe basic agent-environment interaction loop is as follows:\n\n\n```python\nimport gym\nimport macad_gym\n\n\nenv = gym.make(\"HomoNcomIndePOIntrxMASS3CTWN3-v0\")\nconfigs = env.configs\nenv_config = configs[\"env\"]\nactor_configs = configs[\"actors\"]\n\n\nclass SimpleAgent(object):\n def __init__(self, actor_configs):\n \"\"\"A simple, deterministic agent for an example\n Args:\n actor_configs: Actor config dict\n \"\"\"\n self.actor_configs = actor_configs\n self.action_dict = {}\n\n\n def get_action(self, obs):\n \"\"\" Returns `action_dict` containing actions for each agent in the env\n \"\"\"\n for actor_id in self.actor_configs.keys():\n # ... Process obs of each agent and generate action ...\n if env_config[\"discrete_actions\"]:\n self.action_dict[actor_id] = 3 # Drive forward\n else:\n self.action_dict[actor_id] = [1, 0] # Full-throttle\n return self.action_dict\n\n\nagent = SimpleAgent(actor_configs) # Plug-in your agent or use MACAD-Agents\nfor ep in range(2):\n obs = env.reset()\n done = {\"__all__\": False}\n step = 0\n while not done[\"__all__\"]:\n obs, reward, done, info = env.step(agent.get_action(obs))\n print(f\"Step#:{step} Rew:{reward} Done:{done}\")\n step += 1\nenv.close()\n```\n\n### Citing:\n\nIf you find this work useful in your research, please cite:\n\n```bibtex\n@misc{palanisamy2019multiagent,\n title={Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning},\n author={Praveen Palanisamy},\n year={2019},\n eprint={1911.04175},\n archivePrefix={arXiv},\n primaryClass={cs.LG}\n}\n```\n\n
Citation in other Formats: (Click to View)\n

\n

MLA
Palanisamy, Praveen. \"Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning.\" arXiv preprint arXiv:1911.04175 (2019).
APA
Palanisamy, P. (2019). Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning. arXiv preprint arXiv:1911.04175.
Chicago
Palanisamy, Praveen. \"Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning.\" arXiv preprint arXiv:1911.04175 (2019).
Harvard
Palanisamy, P., 2019. Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning. arXiv preprint arXiv:1911.04175.
Vancouver
Palanisamy P. Multi-Agent Connected Autonomous Driving using Deep Reinforcement Learning. arXiv preprint arXiv:1911.04175. 2019 Nov 11.
BibTeX EndNote RefMan RefWorks
\n

\n
\n\n###### **NOTEs**:\n- MACAD-Gym supports multi-GPU setups and it will choose the GPU that is less loaded to launch the simulation needed for the RL training environment\n\n- MACAD-Gym is for CARLA 0.9.x & above . If you are\nlooking for an OpenAI Gym-compatible agent learning environment for CARLA 0.8.x (stable release),\nuse [this carla_gym environment](https://github.com/PacktPublishing/Hands-On-Intelligent-Agents-with-OpenAI-Gym/tree/master/ch8/environment).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/praveen-palanisamy/macad-gym", "keywords": "multi-agent learning environments connected autonomous driving OpenAI Gym CARLA", "license": "", "maintainer": "", "maintainer_email": "", "name": "macad-gym", "package_url": "https://pypi.org/project/macad-gym/", "platform": "", "project_url": "https://pypi.org/project/macad-gym/", "project_urls": { "Author website": "https://praveenp.com", "Homepage": "https://github.com/praveen-palanisamy/macad-gym", "Report bug": "https://github.com/praveen-palanisamy/macad-gym/issues", "Source": "https://github.com/praveen-palanisamy/macad-gym" }, "release_url": "https://pypi.org/project/macad-gym/0.1.4/", "requires_dist": [ "gym", "carla (>=0.9.3)", "GPUtil", "pygame", "opencv-python", "networkx", "tox ; extra == 'test'", "pytest ; extra == 'test'", "pytest-xdist ; extra == 'test'" ], "requires_python": ">=3.0", "summary": "Learning environments for Multi-Agent Connected Autonomous Driving (MACAD) with OpenAI Gym compatible interfaces", "version": "0.1.4", "yanked": false, "yanked_reason": null }, "last_serial": 8284851, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e1c3ad52c6fc191cf94d9d0ec27c83e0", "sha256": "4f7375457fea88bf509ec4269a7501299135adbf7943873ef7aee865f20a3e5b" }, "downloads": -1, "filename": "macad_gym-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e1c3ad52c6fc191cf94d9d0ec27c83e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 109818, "upload_time": "2019-10-13T06:01:05", "upload_time_iso_8601": "2019-10-13T06:01:05.026672Z", "url": "https://files.pythonhosted.org/packages/dc/5f/bd20bf794c12b280ebba4bea52e40c73b2a515f78a951c8524b45fe37835/macad_gym-0.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "e88b3ff5ce6323ea0b2dc7f1a0e260ae", "sha256": "f969f451513d18012c2a99262855a8ea1add9f1462884a09df03dcdddf484ba5" }, "downloads": -1, "filename": "macad-gym-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e88b3ff5ce6323ea0b2dc7f1a0e260ae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 91900, "upload_time": "2019-10-13T06:01:08", "upload_time_iso_8601": "2019-10-13T06:01:08.663090Z", "url": "https://files.pythonhosted.org/packages/50/9c/2cd891cd669f46854532518b00277126b67943dd89b41f7a00e7bd4d0ba1/macad-gym-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7b8a6851b29beb4b2adc8adc4941bb6f", "sha256": "fd20f0aba570d8d6d0b6dfc53af360bf94d6c6995d3106ac221485050ff01d17" }, "downloads": -1, "filename": "macad_gym-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7b8a6851b29beb4b2adc8adc4941bb6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 114563, "upload_time": "2019-10-28T09:41:11", "upload_time_iso_8601": "2019-10-28T09:41:11.416779Z", "url": "https://files.pythonhosted.org/packages/79/c9/4cff33fecce2230e5b3dd946135b5413bf1a996a63e5bc9c16c244f7dfce/macad_gym-0.1.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "edfd346cae8f0bd3a3d1e40872fd33e5", "sha256": "5e59b1309a94883b849a86613109417ab642c17b0f3f7ae4448479ca8e96d3b7" }, "downloads": -1, "filename": "macad-gym-0.1.2.tar.gz", "has_sig": false, "md5_digest": "edfd346cae8f0bd3a3d1e40872fd33e5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 92783, "upload_time": "2019-10-28T09:41:13", "upload_time_iso_8601": "2019-10-28T09:41:13.319071Z", "url": "https://files.pythonhosted.org/packages/a5/0b/e0ffa01158c10982f5fadbc3c57f12998b8d6be2c58904270f2f4cebf151/macad-gym-0.1.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4b61f2260f5b63865e0a72c18bd7f279", "sha256": "9f82b3b6930f69e0170030f0e50d835c0bd5e7ee49b9911124a2be88442057f1" }, "downloads": -1, "filename": "macad_gym-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4b61f2260f5b63865e0a72c18bd7f279", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 115549, "upload_time": "2020-06-07T09:19:18", "upload_time_iso_8601": "2020-06-07T09:19:18.403674Z", "url": "https://files.pythonhosted.org/packages/2c/da/970df369dc4c9599e462043f085ad0e061a78a5ee2c6ba16cab28d82544c/macad_gym-0.1.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "301dd6f139732cb196fba27b2f079be4", "sha256": "ed60234e27cc9a9bbb51bf39649f5e0aff7c63fd58988c71777c5aa037648baf" }, "downloads": -1, "filename": "macad-gym-0.1.3.tar.gz", "has_sig": false, "md5_digest": "301dd6f139732cb196fba27b2f079be4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 96492, "upload_time": "2020-06-07T09:19:19", "upload_time_iso_8601": "2020-06-07T09:19:19.641628Z", "url": "https://files.pythonhosted.org/packages/0b/ed/3a3e00a8f69591bd99e4955540e50c69102359b629e2ce5bdd897505006e/macad-gym-0.1.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "deb6f69c4ae03c523f2b1b5c97987709", "sha256": "c1dd267a025f58a0c028809c02204fe91bb25b1f383bcecce027ecf6ba3c2262" }, "downloads": -1, "filename": "macad_gym-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "deb6f69c4ae03c523f2b1b5c97987709", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 115740, "upload_time": "2020-09-27T20:57:20", "upload_time_iso_8601": "2020-09-27T20:57:20.691577Z", "url": "https://files.pythonhosted.org/packages/04/c5/9ca581dd6d03436141a11fcbbd742837c19bf4cbc85e78bd15e47581044e/macad_gym-0.1.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "3c1802de561d7be58d06f0c1cfd9f73c", "sha256": "8fa12967e1cc5c35a044b3a3d5cf2a628323b3fb11394eae372ba42d170a84b5" }, "downloads": -1, "filename": "macad-gym-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3c1802de561d7be58d06f0c1cfd9f73c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 96884, "upload_time": "2020-09-27T20:57:21", "upload_time_iso_8601": "2020-09-27T20:57:21.737179Z", "url": "https://files.pythonhosted.org/packages/1a/ca/956beace6fc144f21eb4d773ab940a672fe6db7720fcbaefc3f1a3b49213/macad-gym-0.1.4.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "deb6f69c4ae03c523f2b1b5c97987709", "sha256": "c1dd267a025f58a0c028809c02204fe91bb25b1f383bcecce027ecf6ba3c2262" }, "downloads": -1, "filename": "macad_gym-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "deb6f69c4ae03c523f2b1b5c97987709", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 115740, "upload_time": "2020-09-27T20:57:20", "upload_time_iso_8601": "2020-09-27T20:57:20.691577Z", "url": "https://files.pythonhosted.org/packages/04/c5/9ca581dd6d03436141a11fcbbd742837c19bf4cbc85e78bd15e47581044e/macad_gym-0.1.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "3c1802de561d7be58d06f0c1cfd9f73c", "sha256": "8fa12967e1cc5c35a044b3a3d5cf2a628323b3fb11394eae372ba42d170a84b5" }, "downloads": -1, "filename": "macad-gym-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3c1802de561d7be58d06f0c1cfd9f73c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 96884, "upload_time": "2020-09-27T20:57:21", "upload_time_iso_8601": "2020-09-27T20:57:21.737179Z", "url": "https://files.pythonhosted.org/packages/1a/ca/956beace6fc144f21eb4d773ab940a672fe6db7720fcbaefc3f1a3b49213/macad-gym-0.1.4.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }