Choosing an entrypoint

Contents

Choosing an entrypoint#

Pick the smallest tool that fits your goal.

You want to…

Use

Example

Run one scenario exported from the web editor

load_scenario() + run_scenario()

Bottleneck tutorial — jupedsim-scenarios

Sweep one or more numeric parameters

run_sweep()

Why does run_sweep need both axes and apply?

Sweep where geometry or journeys change per trial

run_sweep_from_factory()

How do I sweep over scenario shapes that axes / apply can’t express?

Save a sweep and re-open it in another session

SweepResult.save / SweepResult.load

How do I persist a sweep and reload it later?

Build a scenario in pure Python (no web editor)

Scenario constructor

How do I build a scenario in pure Python (no JSON editing)?

Drive a single run from a shell or CI pipeline

jps-scenarios run CLI

CLI reference

Rules of thumb#

  • One scenario, one outcome → ``run_scenario``. Returns metrics and a trajectory you can plot or feed to pedpy.

  • Same scenario, parameter grid → ``run_sweep``. Define axes (the values to vary) and apply (the mutator per axis). The cartesian product is run with multi-process workers.

  • Per-trial geometry / journey → ``run_sweep_from_factory``. Provide a callable that returns a freshly-built Scenario for each parameter combination. Use this when axes + apply cannot express the variation.

  • Notebook workflow → Python API. Scripted pipeline → CLI. The CLI prints a one-line JSON summary suitable for shell parsing.

See Concepts for the underlying object model.