Exit¶
In this task, the ego-vehicle is driving on a multilane highway and must navigate across lanes to reach an exit ramp. The agent’s objective is to successfully take the exit while maintaining speed and avoiding collisions with surrounding traffic.
Usage¶
env = gym.make("exit-v0")
Versions¶
ID |
Description |
|---|---|
|
Initial version. Same-segment neighbour search only. Preserved for reproducibility. |
|
Connected-lane neighbour search enabled by default. Recommended for new experiments. |
See Neighbour vehicles for details.
Default configuration¶
{
"observation": {
"type": "ExitObservation",
"vehicles_count": 15,
"features": ["presence", "x", "y", "vx", "vy", "cos_h", "sin_h"],
"clip": False,
},
"action": {
"type": "DiscreteMetaAction",
"target_speeds": [18, 24, 30],
},
"lanes_count": 6,
"collision_reward": 0,
"high_speed_reward": 0.1,
"right_lane_reward": 0,
"normalize_reward": True,
"goal_reward": 1,
"vehicles_count": 20,
"vehicles_density": 1.5,
"controlled_vehicles": 1,
"duration": 18, # [s]
"simulation_frequency": 5,
"scaling": 5,
}
More specifically, it is defined in:
- classmethod ExitEnv.default_config() dict[source]
Default environment configuration.
Can be overloaded in environment implementations, or by calling configure(). :return: a configuration dict
API¶
- class highway_env.envs.exit_env.ExitEnv(config: dict = None, render_mode: str | None = None)[source]¶
- classmethod default_config() dict[source]¶
Default environment configuration.
Can be overloaded in environment implementations, or by calling configure(). :return: a configuration dict
- step(action) tuple[ndarray, float, bool, bool, dict][source]¶
Perform an action and step the environment dynamics.
The action is executed by the ego-vehicle, and all other vehicles on the road performs their default behaviour for several simulation timesteps until the next decision making step.
- Parameters:
action – the action performed by the ego-vehicle
- Returns:
a tuple (observation, reward, terminated, truncated, info)