Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lane occupancy calculation bug #13024

Closed
tasosb opened this issue Apr 12, 2023 · 2 comments
Closed

Lane occupancy calculation bug #13024

tasosb opened this issue Apr 12, 2023 · 2 comments
Assignees
Milestone

Comments

@tasosb
Copy link
Contributor

tasosb commented Apr 12, 2023

Hello,

This error occurs for micro-simulation and for vehicles that have their vehicle type changed, while they are moving on a lane. More specifically, in microsim/MSLane.cpp, the brutto occupancy depends on the value myBruttoVehicleLengthSum (veh_length+min_gap). This value is only updated upon entry and exit of a vehicle in the lane, disregarding the fact that the vehicle's length and minGap value can be changed as the vehicle is in the lane, either directly by traci or by changing it's vType. For example, the vehicle's length+min_gap value at the lane exit may be lower than these values at the lane entry, leaving the difference as residue to the value myBruttoVehicleLengthSum. After some time, this leads to an inaccurate 100% occupancy of the lane and no more vehicles are able to join the lane.

Untitled

A possible solution could be to calculate myBruttoVehicleLengthSum and myNettoVehicleLengthSumin getBruttoOccupancy and getNettoOccupancy directly, by iterating the list of vehicles in the lane.

SUMO-version:
v1.16 and git build

operating system:
Windows 10 & Ubuntu

@namdre
Copy link
Contributor

namdre commented Apr 12, 2023

iterating the list of vehicles is probably to inefficient.
Since changing the type of a vehicle is presumably a rare event, updating the occupancy upon type change sounds like a better solution.

Out of curiosity, are you actually changing vehicle lengths or just minGaps at runtime? If the former, what are you modelling?

@tasosb
Copy link
Contributor Author

tasosb commented Apr 12, 2023

Actually the issue came up when using simpla, that generally does a lot of vType changing. More specifically I set a relatively lower min_gap for the follower, catchup and/or catchup follower vTypes than the leader and default vType. In almost 1hour of simulation, the accumulated mingap difference was enough to flag the lane as having reached it's maximum occupancy.

I am only changing the minGaps, not the length, I just mentioned it as there is a relative setLength function that someone could use for a reason.

@namdre namdre added the c:traci label Apr 16, 2023
@namdre namdre added this to the 1.18.0 milestone Apr 28, 2023
@namdre namdre modified the milestones: 1.18.0, 1.20.0, 1.19.0 Jun 20, 2023
@behrisch behrisch modified the milestones: 1.19.0, 1.20.0 Nov 7, 2023
tasosb added a commit to tasosb/sumo that referenced this issue May 4, 2024
@namdre namdre closed this as completed in cf9cab1 May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants