Setup:
python -m venv env
source env/bin/activate
pip install -r requirements.txt
The agent for the Highway Environment can be trained or tested via command line:
# To train a new model (save under models/highway_env):
python highway_agent.py train
# Loads the trained model and runs and renders episodes over its behaviour:
python highway_agent.py test
In the following, we provide some scenarios. The controlled vehicle (ego vehicle) is marked in red.
A vehicle approaches another vehicle in the same lane from behind, the distance decreases. | The rear vehicle brakes. | The rear vehicle continues braking to maintain the safety distance. |
There is another vehicle on another lane further right. | The rear vehicle switches to the right lane, as the safety distance is maintained. | The rear vehicle continues driving forward. |
There is another vehicle on another lane further right. | The rear vehicle cannot switch to the center lane, as the safety distance is not maintained. | The rear vehicle continues driving forward. |