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`
AutonomousMerging.AugScene
— Type.AugScene
Driving scene augmented with information about the ego vehicle
AutonomousMerging.MergingBelief
— Type.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}
AutonomousMerging.MergingUpdater
— Type.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
AutonomousMerging.extract_features
— Function.extract_features(mdp::GenerativeMergingMDP, s::AugScene)
extract a feature vector from AugScene
AutonomousMerging.normalize_features!
— Function.normalize_features!(mdp::GenerativeMergingMDP, features::Vector{Float64})
normalize a feature vector extracted from a scene
AutonomousMerging.unnormalize_features!
— Function. unnormalize_features!(mdp::GenerativeMergingMDP, features::Vector{Float64})
rescale feature vector
AutonomousMerging.initial_merge_car_state
— Function.initial_merge_car_state(mdp::GenerativeMergingMDP, rng::AbstractRNG, id::Int64)
returns a Vehicle, at the initial state of the merging car.
AutonomousMerging.reset_main_car_state
— Function.reset_main_car_state(mdp::GenerativeMergingMDP, veh::Vehicle)
initialize a car at the beginning of the main lane
AutonomousMerging.reachgoal
— Function.reachgoal(mdp::GenerativeMergingMDP, ego::Vehicle)
return true if ego
reached the goal position
AutonomousMerging.caused_hard_brake
— Function.caused_hard_brake(mdp::GenerativeMergingMDP, scene::Scene)
returns true if the ego vehicle caused its rear neighbor to hard brake
AutonomousMerging.action_map
— Function.action_map(mdp::GenerativeMergingMDP, acc::Float64, a::Int64)
maps integer to a LaneFollowingAccel
AutonomousMerging.vehicle_state
— Function.vehicle_state(s::Float64, lane::Lane, v::Float64, roadway::Roadway)
convenient constructor for VehicleState