Generative Merging MDP

Generative Merging MDP

GenerativeMergingMDP

A simulation environment for a highway merging scenario. Implemented using POMDPs.jl

Parameters

- `env::MergingEnvironment = MergingEnvironment(main_lane_angle = 0.0, merge_lane_angle = pi/7)`
- `n_cars_main::Int64 = 1`
- `n_cars_merge::Int64 = 1`
- `n_agents::Int64 = n_cars_main + n_cars_merge`
- `max_cars::Int64 = 16`
- `min_cars::Int64 = 0`
- `car_def::VehicleDef = VehicleDef()`
- `dt::Float64 = 0.5 # time step`
- `jerk_levels::SVector{5, Float64} = SVector(-1, -0.5, 0, 0.5, 1.0)`
- `accel_levels::SVector{6, Float64} = SVector(-4.0, -2.0, -1.0, 0.0, 1.0, 2.0)`
- `max_deceleration::Float64 = -4.0`
- `max_acceleration::Float64 = 3.5`
- `comfortable_acceleration::Float64 = 2.0`
- `discount_factor::Float64 = 0.95`
- `ego_idm::IntelligentDriverModel = IntelligentDriverModel(σ=0.0, v_des=env.main_lane_vmax)`
- `default_driver_model::DriverModel{LaneFollowingAccel} = IntelligentDriverModel(v_des=env.main_lane_vmax)`
- `observe_cooperation::Bool = false`
- `observe_speed::Bool = true`
- `traffic_speed::Symbol = :mixed`
- `random_n_cars::Bool = false`
- `driver_type::Symbol = :random`
- `max_burn_in::Int64 = 20`
- `min_burn_in::Int64 = 10`
- `initial_ego_velocity::Float64 = 10.0`
- `initial_velocity::Float64 = 5.0`
- `initial_velocity_std::Float64 = 1.0`
- `main_lane_slots::LinRange{Float64} = LinRange(0.0, env.main_lane_length + env.after_merge_length, max_cars)`
- `collision_cost::Float64 = -1.0`
- `goal_reward::Float64 = 1.0`
- `hard_brake_cost::Float64 = 0.0`
source
AugScene

Driving scene augmented with information about the ego vehicle

source
MergingBelief

A type to represent belief state. It consists of the current observation o and the estimated driver types represented by a dictionnary mapping ID to cooperation levels.

fields

  • o::AugScene
  • driver_types::Dict{Int64, Float64}
source
MergingUpdater <: Updater

A belief updater for MergingBelief. It sets o to the current observation and updates the belief on the drivers cooperation level using Bayes' rule

source
extract_features(mdp::GenerativeMergingMDP, s::AugScene)

extract a feature vector from AugScene

source
normalize_features!(mdp::GenerativeMergingMDP, features::Vector{Float64})

normalize a feature vector extracted from a scene

source
 unnormalize_features!(mdp::GenerativeMergingMDP, features::Vector{Float64})

rescale feature vector

source
initial_merge_car_state(mdp::GenerativeMergingMDP, rng::AbstractRNG, id::Int64)

returns a Vehicle, at the initial state of the merging car.

source
reset_main_car_state(mdp::GenerativeMergingMDP, veh::Vehicle)

initialize a car at the beginning of the main lane

source
reachgoal(mdp::GenerativeMergingMDP, ego::Vehicle)

return true if ego reached the goal position

source
caused_hard_brake(mdp::GenerativeMergingMDP, scene::Scene)

returns true if the ego vehicle caused its rear neighbor to hard brake

source
action_map(mdp::GenerativeMergingMDP, acc::Float64, a::Int64)

maps integer to a LaneFollowingAccel

source
vehicle_state(s::Float64, lane::Lane, v::Float64, roadway::Roadway)

convenient constructor for VehicleState

source