jupedsim_scenarios.local

jupedsim_scenarios.local#

Seed sweep of one scenario into an output directory.

run_local() is the library form of jps-scenarios sweep: it loads the scenario, optionally scales it, runs every seed, and writes scenario.json plus sweep.json next to the trial sqlites. It prints nothing; callers render progress themselves. The exported run.py of the web app and the CLI both go through it so the output layout is defined once, and report.build_report() reads it back.

Functions#

run_local(→ jupedsim_scenarios.sweep.SweepResult)

Run scenario over seeds and save the sweep under out_dir.

Module Contents#

run_local(scenario: jupedsim_scenarios.runner.Scenario | str | os.PathLike, *, out_dir: str | os.PathLike, seeds: collections.abc.Sequence[int] | int = 10, workers: int = 1, dt: float | None = None, every_nth_frame: int = 10, scale: float = 1.0, scale_mode: str = 'count', progress: collections.abc.Callable[[int, int, dict], None] | None = None) jupedsim_scenarios.sweep.SweepResult[source]#

Run scenario over seeds and save the sweep under out_dir.

Parameters:
  • scenario – A loaded Scenario or anything load_scenario() accepts (JSON file, ZIP archive, directory). A loaded scenario is scaled in place when scale != 1.0.

  • out_dir – Output directory: trial_<index>.sqlite per seed, scenario.json (the scenario as run) and sweep.json.

  • seeds – Explicit seeds, or an int N meaning range(N).

  • workers – Passed through to run_sweep().

  • dt – Passed through to run_sweep().

  • every_nth_frame – Passed through to run_sweep().

  • progress – Passed through to run_sweep().

  • scale – Passed to Scenario.scale_agents() when scale != 1.0; CapacityError propagates.

  • scale_mode – Passed to Scenario.scale_agents() when scale != 1.0; CapacityError propagates.

Returns:

With meta filled in (scenario_source, scenario_json, scale, scale_mode, seeds, dt, every_nth_frame, wall_clock_s, library_version), already saved to out_dir / "sweep.json".

Return type:

SweepResult