a-b-street / a-b-street/abstreet
Consider changing how lane-changing works
- Vorherrschende Sprache
- Rust
- Sterne
- 8.2k
- Forks
- 380
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
#139 has some ideas about how to model discretionary lane-changing (dodging slower people, not required for making a turn). But someone from reddit recently sent in some ideas for modelling it more generally. Copying from their message:
> Basically I think the assumption that the cars don't change lane is good apart from in two situations -when the car is blocked (ie in a queue or behind a slow vehicle) -when a car is close to a junction I also think that the assumption that cars only change lane at the junction is great as a first pass for the second case, but ideally they should make such a decision before the junction to allow for left turns etc.
> The idea I have is to initiate a lane change when the cars in two cases: 1) the car reaches a decision point a fixed distance from the junction 2) the car is stuck behind the previous vehicle in a queue / due to speed of bike, and is far from the junction (ie it has not already passed the fixed decision point
> In case 1 the distance a decision point is from a junction depends on the number of lanes a car could change, ie if a three lane road the middle lane has a point 100m from the junction and on the outside lanes the point is 200m (arbitrary distance). If a road is too short to have a decision point the decision should be made before entering the road-100/200m from the previous junction (ie no lane change allowed as in current uber junction). If the road is too short for the 200m decision point but can have a 100m point the car should only be able to change lane once, and the decision at the previous junction should be under the assumption that the car can only make one lane change after crossing the junction. At this stage the car should choose a lane to take. This should be the lane with the shortest queue of cars between it and the junction, that still allows the car to make the desired turn at the junction. The decision point should act as the last possible point a car can make a turn, if the car is to make 1 turn it must do it befoe it is within 100m from the junction. If it is not able to smoothly change lanes before this point it should stop at the point and wait for a gap to change lanes/ untill the queue in the next lane is larger than the queue in the current lane. The cars at a decision point should act as they currently do in a junction if a car is attempting to change lane at the point. As a first pass you would not include smooth lane changing and only change at the decision point. Smooth lane changing would require the decisions to de made a fixed distance before the car reaches the decision point.
> In case 2 the car should make the same queue assessment as the previous case, but count the shortest queue of stationary cars between it and the next decision point. Since it has yet to pass a decision point it won't have to check if it can still reach the destination. We could also later add the ability to overtake and merge back into the same lane but this would be more resource heavy. We might also already see this effect if the car changes lane back at the next decision point. We should only allow this sort of lane changing if the car has yet to pass the stationary decision points before a junction, and would not be turning into a lane which has also passed this point. The action of changing lane could be handled by the same code as changing lane at a decision point.
> Since the car should already be in the correct lane at a junction we no longer allow changes at a junction. The car should also no longer make decisions based of traffic in the road past the junction which prevents the stackoverflow caused by a looped road. The only issue is if the next road does not have its own decision points, in which case a car might make the 'wrong' decision when deciding on the fatest lane. This is not too much of a problem though since -The road is short, so the queue should only be short. -In real life the driver might not consider the queue in the road, as they would me more focused on the junction at hand. They would also be unlikely to change lane so close to the next junction as it would be dangerous.
And my initial response: I think your concept of "decision points" could be a big help, and kind of model how people behave in real life. I haven't thought much about implementation yet, but they could maybe be treated as an invisible/virtual intersection, with rules to prioritize the turns there (so that somebody has to yield when merging into another lane). These would have to be created last-minute, to allow for vehicles over-taking slower vehicles anywhere on a road before the decision point.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.