Dux02 / AM2050

Project am2050a
0 stars 0 forks source link

Crashes due to mergers #10

Open Blasylf opened 10 months ago

Blasylf commented 10 months ago

For some reason, there are crashes due to mergers. The merging logic has changed quite a fair bit in the (upcoming) recent commit, so it may be due to that. In any case, in order to try and catch it, I've added a few debugging methods to Car (see, Car.debugcounter) and VisualSimulation - after the 10th crash, it will follow that car along. It hasn't been of great help, because the debugged car seems to be stacked on top of another car, but again, needs further investigation.

Changes to the merging logic:

[] now that I write this, I think maybe we could implement an if statement, if the othercar's velocity is simply slower than the desired velocity (scaled to, say, 90%), then we don't merge. It would prevent rubberbanding. OTOH it would mean during times of traffic where everyone's slow, the fast lane ends up being congested.*