Skip to main content

Python PyPI build pre-commit Code style: black


An episode of one of the environments available in HighwayEnv.

A collection of environments for autonomous driving and tactical decision-making tasks. Originally developed by Edouard Leurent and currently maintained by Jin Huang.

The documentation website is at highway-env.farama.org, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6

Installation

To install HighwayEnv, use:

pip install highway-env

or with uv:

uv add highway-env          # adds to project dependencies and installs (preferred)
uv pip install highway-env  # or install without adding to a project (pip install)

We support Linux and macOS primarily, with Windows support maintained on a best-effort basis.

Environments

HighwayEnv includes 10 driving scenario families: highway, intersection, exit, lane-keeping, merge, parking, racetrack, roundabout, two-way, and u-turn, with several environments also offering fast, continuous-control, connected-lane, multi-agent, generic, large, or oval variants. The full list with descriptions and configuration options is available in the documentation.

Previews
highway highway
merge merge
roundabout roundabout
parking parking
intersection intersection
racetrack racetrack
lane-keeping lane-keeping
two-way two-way
exit exit
u-turn u-turn

Usage

import gymnasium as gym
import highway_env

gym.register_envs(highway_env)

# Initialise the environment
env = gym.make("highway-v0", config={"lanes_count": 3}, render_mode="human")

# Reset the environment to generate the first observation
obs, info = env.reset()
for _ in range(1000):
    # this is where you would insert your policy
    action = env.action_space.sample()

    # step (transition) through the environment with the action
    # receiving the next observation, reward and if the episode has terminated or truncated
    obs, reward, terminated, truncated, info = env.step(action)

    # If the episode has ended then we can reset to start a new episode
    if terminated or truncated:
        obs, info = env.reset()

env.close()

See the documentation for more examples including how to train agents with Stable Baselines3 and Google Colab notebooks. For examples of trained agents (DQN, DDPG, Value Iteration, MCTS), see the Agent Examples page.

Documentation

Read the documentation online.

Development Roadmap

Here is the roadmap for future development work.

Citating

If you use HighwayEnv in your work, please consider citing it with:

@misc{highway-env,
  author = {Leurent, Edouard},
  title = {An Environment for Autonomous Driving Decision-Making},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/Farama-Foundation/HighwayEnv}},
}

Publications

A list of publications using HighwayEnv can be found in the documentation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

highway_env-1.12.1.tar.gz (93.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

highway_env-1.12.1-py3-none-any.whl (111.0 kB view details)

Uploaded Python 3

File details

Details for the file highway_env-1.12.1.tar.gz.

File metadata

  • Download URL: highway_env-1.12.1.tar.gz
  • Upload date:
  • Size: 93.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for highway_env-1.12.1.tar.gz
Algorithm Hash digest
SHA256 d941d0d60551debf9a12bd8c0e1c26f34711a47cf4074b3522fed8518f31eb48
MD5 9790cfc643d08db8646afdee6c1cdd82
BLAKE2b-256 304ec5e4376f032acc5a5d4c0200a10961bd22e0f273de79d810a65671c4f952

See more details on using hashes here.

Provenance

The following attestation bundles were made for highway_env-1.12.1.tar.gz:

Publisher: publish.yml on Farama-Foundation/HighwayEnv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file highway_env-1.12.1-py3-none-any.whl.

File metadata

  • Download URL: highway_env-1.12.1-py3-none-any.whl
  • Upload date:
  • Size: 111.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for highway_env-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3bf8089e8d59f63549c2891cf8d9b5d529ac9863f037eb6ab98231ec802cd53d
MD5 144e5616ba7bccd45a8663f5a1b7ce52
BLAKE2b-256 1536ee4c418e6da88d1d27328ac8687b321e6e26801886fdd27ae4405786cc78

See more details on using hashes here.

Provenance

The following attestation bundles were made for highway_env-1.12.1-py3-none-any.whl:

Publisher: publish.yml on Farama-Foundation/HighwayEnv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page