Skip to content

Make a step to KKW implementing VDR - #17

Open
LdDl wants to merge 20 commits into
masterfrom
refactor/kkw
Open

Make a step to KKW implementing VDR#17
LdDl wants to merge 20 commits into
masterfrom
refactor/kkw

Conversation

@LdDl

@LdDl LdDl commented Jun 29, 2026

Copy link
Copy Markdown
Owner

WORK IN PROGRES

Removes the unfinished, mis-calibrated KKW (Kerner–Klenov–Wolf ) layer and replaces it with VDR (Velocity-Dependent Randomization) baseline plus the full driver-behaviour machinery (aggression gradient, patience, lane-change safety) that a future KKW layer will build on.

1. VDR

The longitudinal model is now plain NaSch + two-level VDR: a moving-dawdle probability p and a higher slow-to-start probability p0 while stopped (p0 ≥ p). This produces the realistic capacity drop / metastability - the foundation KKW is built on.

2. Driver style as one continuous gradient

Aggressiveness is now a continuous aggressive_level = 1 - cooperativity (no longer an enum type). Behaviour presets derive change_p1 (the probability of actually committing an allowed lane change) and lc_cooldown from it.

3. Cut-in aggressors

New gradient aggressor_advantage (constant threshold 0.8): an aggressive driver cuts in - bypasses the rear-safety gap at intention time and wins a contested cell against any less-aggressive vehicle, forcing it to brake. Applied uniformly across all non-physical conflict rules (merge-lane-change, merge-forward, forward-lane-change, cross-lane-change). Replaces the old coarse "Aggressive-enum vs Cooperative-enum" checks.

4. Patience / desperate override (deadlock escape)

A vehicle starved past patience() (300–700 steps, scaled by cooperativity) forces its way through - it wins any non-physical contested cell. The most-starved vehicle wins, ties broken by lowest id; it never pushes through a physical tail (a body); the one-occupant-per-cell invariant is preserved (claimed-cells + occupancy check + sweep-through clamp).

5. Lane-change safety & anti-weaving

Speed-aware rear gap (rear_safe, using a start-of-step speed snapshot) + front gap (clear_forward) + an incentive gate + a stochastic P1 commit. Plus a per-type reactive lane-change cooldown (timer_reactive_lane_change / lc_cooldown).

6. Determinism

Seedable RNG (MTSC_SEED); all stochastic draws are unconditional and in a fixed per-vehicle order. A* tie-break via total_cmp (NaN-safe). The full-tie conflict tie-break went from a coin flip to lowest vehicle id (invariant to participant order). Result: under a fixed seed its runs in a reproducible way.

8. Tests

Extensive new coverage: desperate override (across every conflict type), cut-in aggressor (forward and crossing), order-invariance of the lowest-id tie-break, the P1-vs-aggressiveness mapping, and determinism.

References

Cellular-automata traffic model (Keldysh Institute of Applied Mathematics, RAS):

  • A. A. Chechina, N. G. Churbanova, M. A. Trapeznikova. A cellular automata model for describing mixed flow of passenger cars and trucks on multilane highways // Computer Research and Modeling, 2026, Vol. 18, No. 1, pp. 61–80. https://doi.org/10.20537/2076-7633-2026-18-1-61-80
  • A. A. Chechina. Driver behaviour algorithms for overcoming unsignalized intersections with priority pass and for bypassing an obstacle // Matematicheskoe Modelirovanie, 2021, Vol. 33, No. 9, pp. 47–59. https://doi.org/10.20948/mm-2021-09-04
  • A. A. Chechina, N. G. Churbanova, M. A. Trapeznikova. Comparison of the reproduction of spatiotemporal traffic-flow structures using different data-averaging methods // Matematicheskoe Modelirovanie, 2021, Vol. 33, No. 1, pp. 25–35. https://doi.org/10.20948/mm-2021-01-02
  • N. G. Churbanova, A. A. Chechina, M. A. Trapeznikova, P. A. Sokolov. Simulation of traffic flows on road segments using cellular automata theory and quasigasdynamic approach // Mathematica Montisnigri, 2019, Vol. XLVI, pp. 72–90. https://doi.org/10.20948/mathmontis-2019-46-7
  • M. A. Trapeznikova, I. R. Furmanov, N. G. Churbanova, R. Lipp. Simulation of multilane vehicle traffic flows based on the cellular automata theory // Matematicheskoe Modelirovanie, 2011, Vol. 23, No. 6, pp. 133–146.
  • M. A. Trapeznikova, A. A. Chechina, N. G. Churbanova. Two-dimensional cellular automata model for simulation of traffic flows on the elements of a city road network // Matematicheskoe Modelirovanie, 2017, Vol. 29, No. 9, pp. 110–120.

@LdDl LdDl self-assigned this Jun 29, 2026
@LdDl LdDl added documentation Improvements or additions to documentation enhancement New feature or request core Core functions labels Jun 29, 2026
@LdDl
LdDl changed the base branch from feature/routing to master June 29, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core functions documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant