<commit_before>export
    LidarSensor,
    nbeams,
    observe!,
    RoadlineLidarSensor,
    nlanes,
    LanePortion,
    RoadwayLidarCulling,
    ensure_leaf_in_rlc!,
    get_lane_portions

#############################################################
# Lidar Sensor

mutable struct LidarSensor
    angles::Vector{Float64}
    ranges::Vector{Float64}
    range_rates::Vector{Float64}
    max_range::Float64
    poly::ConvexPolygon
end
function LidarSensor(nbeams::Int;
    max_range::Float64=100.0,
    angle_offset::Float64=0.0,
    angle_spread::Float64=2*pi,
    )

    if nbeams > 1
        angles = collect(range(angle_offset-angle_spread/2, stop=angle_offset + angle_spread/2, length=nbeams+1))[2:end]
    else
        angles = Float64[]
        nbeams = 0
    end

    ranges = Array{Float64}(undef, nbeams)
    range_rates = Array{Float64}(undef, nbeams)
    LidarSensor(angles, ranges, range_rates, max_range, ConvexPolygon(4))
end
nbeams(lidar::LidarSensor) = length(lidar.angles)
function observe!(lidar::LidarSensor, scene::Scene, roadway::Roadway, vehicle_index::Int)
    state_ego = scene[vehicle_index].state
    egoid = scene[vehicle_index].id
    ego_vel = polar(state_ego.v, state_ego.posG.θ)

    # precompute the set of vehicles within max_range of the vehicle
    in_range_ids = Set()
    for veh in scene
        if veh.id != egoid 
            distance = hypot(state_ego.posG - veh.state.posG)
            # account for the length and width of the vehicle by considering<commit_msg>update hypot of VecSE2 to be norm of VecE2<commit_after>export
    LidarSensor,
    nbeams,
    observe!,
    RoadlineLidarSensor,
    nlanes,
    LanePortion,
    RoadwayLidarCulling,
    ensure_leaf_in_rlc!,
    get_lane_portions

#############################################################
# Lidar Sensor

mutable struct LidarSensor
    angles::Vector{Float64}
    ranges::Vector{Float64}
    range_rates::Vector{Float64}
    max_range::Float64
    poly::ConvexPolygon
end
function LidarSensor(nbeams::Int;
    max_range::Float64=100.0,
    angle_offset::Float64=0.0,
    angle_spread::Float64=2*pi,
    )

    if nbeams > 1
        angles = collect(range(angle_offset-angle_spread/2, stop=angle_offset + angle_spread/2, length=nbeams+1))[2:end]
    else
        angles = Float64[]
        nbeams = 0
    end

    ranges = Array{Float64}(undef, nbeams)
    range_rates = Array{Float64}(undef, nbeams)
    LidarSensor(angles, ranges, range_rates, max_range, ConvexPolygon(4))
end
nbeams(lidar::LidarSensor) = length(lidar.angles)
function observe!(lidar::LidarSensor, scene::Scene, roadway::Roadway, vehicle_index::Int)
    state_ego = scene[vehicle_index].state
    egoid = scene[vehicle_index].id
    ego_vel = polar(state_ego.v, state_ego.posG.θ)

    # precompute the set of vehicles within max_range of the vehicle
    in_range_ids = Set()
    for veh in scene
        if veh.id != egoid 
            distance = norm(VecE2(state_ego.posG - veh.state.posG))
            # account for the length and width of the vehicle by considering
{'fraction_non_alphanumeric': 0.13512627090849458, 'fraction_numerical': 0.0232863233847163, 'mean_word_length': 3.7581903276131046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866060', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1048, 'n_words': 205}