Roundabout¶
In this task, the ego-vehicle if approaching a roundabout with flowing traffic. It will follow its planned route automatically, but has to handle lane changes and longitudinal control to pass the roundabout as fast as possible while avoiding collisions.
Usage¶
env = gym.make("roundabout-v0")
Default configuration¶
{
"observation": {
"type": "TimeToCollision"
},
"action": {
"type": "DiscreteMetaAction"
},
"incoming_vehicle_destination": None,
"duration": 11
"simulation_frequency": 15, # [Hz]
"policy_frequency": 1, # [Hz]
"other_vehicles_type": "highway_env.vehicle.behavior.IDMVehicle",
"screen_width": 600, # [px]
"screen_height": 600, # [px]
"centering_position": [0.5, 0.6],
"scaling": 5.5,
"show_trajectories": False,
"render_agent": True,
"offscreen_rendering": False
}
More specifically, it is defined in:
API¶
-
class
highway_env.envs.roundabout_env.
RoundaboutEnv
(config: dict = None)[source]¶ -
COLLISION_REWARD
: float = -1¶
-
HIGH_SPEED_REWARD
: float = 0.2¶
-
RIGHT_LANE_REWARD
: float = 0¶
-
LANE_CHANGE_REWARD
: float = -0.05¶
-
classmethod
default_config
() → dict[source] Default environment configuration.
Can be overloaded in environment implementations, or by calling configure(). :return: a configuration dict
-
_reward
(action: int) → float[source]¶ Return the reward associated with performing a given action and ending up in the current state.
- Parameters
action – the last action performed
- Returns
the reward
-
_is_terminal
() → bool[source]¶ The episode is over when a collision occurs or when the access ramp has been passed.
-
reset
() → numpy.ndarray[source]¶ Reset the environment to it’s initial configuration
- Returns
the observation of the reset state
-
step
(action: int) → Tuple[numpy.ndarray, float, 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, terminal, info)
-
_make_vehicles
() → None[source]¶ Populate a road with several vehicles on the highway and on the merging lane, as well as an ego-vehicle.
- Returns
the ego-vehicle
-
__annotations__
= {'COLLISION_REWARD': <class 'float'>, 'HIGH_SPEED_REWARD': <class 'float'>, 'LANE_CHANGE_REWARD': <class 'float'>, 'RIGHT_LANE_REWARD': <class 'float'>}¶
-
__module__
= 'highway_env.envs.roundabout_env'¶
-