-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shift to using pyproject.toml rather than setup.cfg and setup.py
- Loading branch information
1 parent
0d26a5c
commit 7f9f4f6
Showing
14 changed files
with
336 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,50 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
[project] | ||
name = "highway-env" | ||
description = "An environment for simulated highway driving tasks." | ||
readme = "README.md" | ||
requires-python = ">= 3.8" | ||
authors = [{ name = "Edouard Leurent", email = "eleurent@gmail.com" }] | ||
license = { text = "MIT License" } | ||
keywords = ["Reinforcement Learning", "car simulation", "RL", "AI"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"License :: OSI Approved :: MIT License", | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Scientific/Engineering :: Artificial Intelligence', | ||
] | ||
build-backend = "setuptools.build_meta" | ||
dependencies = [ | ||
"gymnasium >=0.28.0", | ||
"farama-notifications >=0.0.1", | ||
"numpy >=1.21.0", | ||
"pygame >=2.0.2", | ||
"matplotlib", | ||
"pandas", | ||
"scipy" | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
testing = [ | ||
"pytest", | ||
"pytest-cov" | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://farama.org" | ||
Repository = "https://github.com/eleurent/highway-env" | ||
Documentation = "https://highway-env.farama.org/" | ||
"Bug Report" = "https://github.com/eleurent/highway-env/issues" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["highway_env", "highway_env.*"] | ||
|
||
[tool.setuptools.package-data] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,100 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "QKWvMXWMBEJA" | ||
}, | ||
"source": [ | ||
"# Behavioural Planning for Autonomous Highway Driving\n", | ||
"\n", | ||
"We plan a trajectory using the _Optimistic Planning for Deterministic systems_ ([OPD](https://hal.inria.fr/hal-00830182)) algorithm.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "s-ghXis6A_md" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"#@title Imports for env, agent, and visualisation.\n", | ||
"# Environment\n", | ||
"!pip install highway-env\n", | ||
"import gymnasium as gym\n", | ||
"import highway_env\n", | ||
"\n", | ||
"# Agent\n", | ||
"!pip install git+https://github.com/eleurent/rl-agents#egg=rl-agents\n", | ||
"from rl_agents.agents.common.factory import agent_factory\n", | ||
"\n", | ||
"# Visualisation\n", | ||
"import sys\n", | ||
"from tqdm.notebook import trange\n", | ||
"!pip install moviepy -U\n", | ||
"!pip install imageio_ffmpeg\n", | ||
"!pip install pyvirtualdisplay\n", | ||
"!apt-get install -y xvfb ffmpeg\n", | ||
"!git clone https://github.com/Farama-Foundation/HighwayEnv.git\n", | ||
"sys.path.insert(0, './highway-env/scripts/')\n", | ||
"from utils import record_videos, show_videos\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "bgNDDWwqCj8l" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"#@title Run an episode\n", | ||
"\n", | ||
"# Make environment\n", | ||
"env = gym.make(\"highway-fast-v0\", render_mode=\"rgb_array\")\n", | ||
"env = record_videos(env)\n", | ||
"(obs, info), done = env.reset(), False\n", | ||
"\n", | ||
"# Make agent\n", | ||
"agent_config = {\n", | ||
" \"__class__\": \"<class 'rl_agents.agents.tree_search.deterministic.DeterministicPlannerAgent'>\",\n", | ||
" \"env_preprocessors\": [{\"method\":\"simplify\"}],\n", | ||
" \"budget\": 50,\n", | ||
" \"gamma\": 0.7,\n", | ||
"}\n", | ||
"agent = agent_factory(env, agent_config)\n", | ||
"\n", | ||
"# Run episode\n", | ||
"for step in trange(env.unwrapped.config[\"duration\"], desc=\"Running...\"):\n", | ||
" action = agent.act(obs)\n", | ||
" obs, reward, done, truncated, info = env.step(action)\n", | ||
" \n", | ||
"env.close()\n", | ||
"show_videos()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"name": "highway-planning.ipynb", | ||
"provenance": [] | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"pycharm": { | ||
"stem_cell": { | ||
"cell_type": "raw", | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"source": [] | ||
} | ||
} | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "QKWvMXWMBEJA" | ||
}, | ||
"source": [ | ||
"# Behavioural Planning for Autonomous Highway Driving\n", | ||
"\n", | ||
"We plan a trajectory using the _Optimistic Planning for Deterministic systems_ ([OPD](https://hal.inria.fr/hal-00830182)) algorithm.\n" | ||
] | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "s-ghXis6A_md" | ||
}, | ||
"source": [ | ||
"#@title Imports for env, agent, and visualisation.\n", | ||
"# Environment\n", | ||
"!pip install highway-env\n", | ||
"import gymnasium as gym\n", | ||
"import highway_env\n", | ||
"\n", | ||
"# Agent\n", | ||
"!pip install git+https://github.com/eleurent/rl-agents#egg=rl-agents\n", | ||
"from rl_agents.agents.common.factory import agent_factory\n", | ||
"\n", | ||
"# Visualisation\n", | ||
"import sys\n", | ||
"from tqdm.notebook import trange\n", | ||
"!pip install moviepy -U\n", | ||
"!pip install imageio_ffmpeg\n", | ||
"!pip install pyvirtualdisplay\n", | ||
"!apt-get install -y xvfb ffmpeg\n", | ||
"!git clone https://github.com/Farama-Foundation/HighwayEnv.git\n", | ||
"sys.path.insert(0, './highway-env/scripts/')\n", | ||
"from utils import record_videos, show_videos\n" | ||
], | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "bgNDDWwqCj8l" | ||
}, | ||
"source": [ | ||
"#@title Run an episode\n", | ||
"\n", | ||
"# Make environment\n", | ||
"env = gym.make(\"highway-fast-v0\", render_mode=\"rgb_array\")\n", | ||
"env = record_videos(env)\n", | ||
"(obs, info), done = env.reset(), False\n", | ||
"\n", | ||
"# Make agent\n", | ||
"agent_config = {\n", | ||
" \"__class__\": \"<class 'rl_agents.agents.tree_search.deterministic.DeterministicPlannerAgent'>\",\n", | ||
" \"env_preprocessors\": [{\"method\":\"simplify\"}],\n", | ||
" \"budget\": 50,\n", | ||
" \"gamma\": 0.7,\n", | ||
"}\n", | ||
"agent = agent_factory(env, agent_config)\n", | ||
"\n", | ||
"# Run episode\n", | ||
"for step in trange(env.unwrapped.config[\"duration\"], desc=\"Running...\"):\n", | ||
" action = agent.act(obs)\n", | ||
" obs, reward, done, truncated, info = env.step(action)\n", | ||
" \n", | ||
"env.close()\n", | ||
"show_videos()" | ||
], | ||
"outputs": [] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"name": "highway-planning.ipynb", | ||
"provenance": [] | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"pycharm": { | ||
"stem_cell": { | ||
"cell_type": "raw", | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"source": [] | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Oops, something went wrong.