feat: add participant runtime simulation with traffic signal scheduling

- Implement deterministic participant simulation in cesium-preview.js with
  fixed-seed arrival, IDM car-following, stop-line constraints, and
  geometric conflict occupancy detection
- Build native traffic simulation participants from road package data
  including signal phase mapping, crosswalk centerlines, and lane routing
- Add participant runtime regression test covering 600 s simulation,
  green-only releases, and 2D bounding box overlap checks
- Update model URI prefix to _preview/ so simulation JSON resolves assets
  relative to area output directory
- Sync Trellis spec and task docs for participant scheduling contract
This commit is contained in:
que01 committed 2026-10-10 16:07:00 +08:00
1 parent c1277af16a
commit 7ce412e52e
10 files changed
+1587 -43

No files matched your search

+4 -1
View File
@@ -571,7 +571,10 @@ function writeCesiumPreview(area, roadProvider) {
} else {
const nativePackage = importNativeRoadPackage(area);
Object.assign(previewInputs, nativeRoadRecords(nativePackage));
const simulation = buildNativeTrafficSimulation(area, { nativePackage });
// The simulation JSON is loaded by the preview HTML, so model URIs must
// be relative to the area output (where `_preview/` is the asset root),
// not relative to the repository's source asset directory.
const simulation = buildNativeTrafficSimulation(area, { nativePackage, modelPrefix: "_preview/" });
fs.mkdirSync(path.dirname(area.outputs.trafficSimulation), { recursive: true });
fs.writeFileSync(area.outputs.trafficSimulation, `${JSON.stringify(simulation, null, 2)}\n`);
routeArtifact = area.outputs.trafficSimulation;