the functions get_neighbor_fore_along_lane, get_neighbor_fore_along_left_lane ... contain a lot of repeated code.
It could be nice to redesign this part to have one function find_neighbor that would accept as argument the specification: fore, rear, left lane, right lane ...
The signature could be find_neighbor(scene, roadway, ego, lane; rear=False). This function would find the front neighbor of ego in lane. It would find the rear neihbor if rear is set to true.
the functions
get_neighbor_fore_along_lane
,get_neighbor_fore_along_left_lane
... contain a lot of repeated code.It could be nice to redesign this part to have one function
find_neighbor
that would accept as argument the specification: fore, rear, left lane, right lane ... The signature could befind_neighbor(scene, roadway, ego, lane; rear=False)
. This function would find the front neighbor ofego
inlane
. It would find the rear neihbor if rear is set to true.