social_force_step — DRIVE traffic op

• Data kinds: points × points × points → any

• Call: import fullseye as fs; fs.ledger.social_force_step(pos, vel, goals, *, dt: 'float', v0, tau: 'float', A: 'float', B: 'float', radius, walls=None) (to call the implementation directly, import drivetraffic; drivetraffic.social_force_step(pos, vel, goals, *, dt: 'float', v0, tau: 'float', A: 'float', B: 'float', radius, walls=None); from the registry, opsdrive.get("social_force_step"))

Usage

1 step of the social force model (per unit mass; in the form of Helbing & Molnár 1995 / Helbing, Farkas, Vicsek 2000).

dv_i/dt = (v0_i e_i − v_i)/τ + Σ_j A exp((r_ij − d_ij)/B) n_ij + Σ_W A exp((r_i − d_iW)/B) n_iW

e_i = unit vector toward the goal (0 if within 1e-9 m of the goal), r_ij = r_i + r_j, d_ij = |x_i − x_j|, n_ij = (x_i − x_j)/d_ij. Walls W are a list of segments ((x0, y0), (x1, y1)); d_iW and n_iW are taken from the closest point.

Integration (exponential integrator): the repulsive force F is held constant over the step, and the linear part (v_d − v)/τ (v_d = v0 e + τ F) is solved exactly:

v' = v_d + (v − v_d) e^{−dt/τ}, x' = x + v_d dt + (v − v_d) τ (1 − e^{−dt/τ}). For one person with no repulsion this matches v(t) = v0(1 − e^{−t/τ}) independently of dt (gate). With repulsion the error is first order.

Arguments: pos, vel, goals are (N, 2). v0 and radius are scalars or (N,). walls is (M, 2, 2) or None.

Returns: (pos', vel'). If the configuration is mirror- or point-symmetric, the result keeps the same symmetry (because the equations are symmetric; checked by a gate).

Raises ValueError: shape mismatch, non-finite values, τ, B or dt ≤ 0, A < 0, radius < 0, two people at the same position.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• gallery_drive_mirrors_crowds — py -3.11 examples/gallery_drive_mirrors_crowds.py

Ops the type connects to (they accept any as input)

course_crank · course_s_curve · course_turnaround · course_slope · course_intersection · course_parallel_parking · course_crossing · course_road

Same category (traffic)

idm_accel · idm_equilibrium_gap · idm_platoon_simulate · driver_style · lateral_wobble · ou_estimate · pedestrian_crossing · occlusion_reveal_distance


*Provenance: drivetraffic.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.