cars: add time-based traffic profile with weekend and Sunday peaks

This commit is contained in:
Richard Zink committed 2026-10-12 21:54:43 +02:00
1 parent 19a2759685
commit e3250a34da
2 files changed
+77 -22

No files matched your search

+22 -1
View File
@@ -317,7 +317,28 @@ window.CONFIG = {
spreadFloor: 0.30, // share that far side roads keep
speed: 1.0, // flow speed multiplier
density: 1.0, // vehicle density multiplier
brightness: 1.3 // vehicle light intensity
brightness: 1.3, // vehicle light intensity
// Time-based traffic profile. Values are multipliers around the
// configured density. Times are local scene-clock hours.
timeProfile: {
enabled: true,
weekday: 1.0, // Mon-Fri base traffic
saturday: 0.65, // weekend reduction
sunday: 0.55, // weekend reduction
morningPeak: 7.7, // rush-hour morning peak
morningWidth: 1.2, // gaussian sigma in hours
morningGain: 0.55, // +55 % at the peak
eveningPeak: 17.5, // rush-hour evening peak
eveningWidth: 1.4,
eveningGain: 0.75, // +75 % at the peak
fridayEveningGain: 0.35,
sundayEveningPeak: 18.5,
sundayEveningWidth: 1.8,
sundayEveningGain: 0.85, // commuter return traffic
nightReduction: 0.70 // deep-night traffic reduced to 30 %
// timeProfile: { enabled: false }
// timeProfile: { morningGain: 0.8, eveningGain: 1.0, nightReduction: 0.85 }
}
// speed: 2.0, density: 0.6, brightness: 1.0
},