Command-Line Options

The scenic command supports a variety of options. Run scenic -h for a full list with short descriptions; we elaborate on some of the most important options below.

Options may be given before and after the path to the Scenic file to run, so the syntax of the command is:

$ scenic [options] FILE [options]

General Scenario Control

-m <model>, --model <model>

Specify the world model to use for the scenario, overriding any model statement in the scenario. The argument must be the fully qualified name of a Scenic module found on your PYTHONPATH (it does not necessarily need to be built into Scenic). This allows scenarios written using a generic model, like that provided by the Driving Domain, to be executed in a particular simulator (see the dynamic scenarios tutorial for examples).

The equivalent of this option for the Python API is the model argument to scenic.scenarioFromFile.

-p <param> <value>, --param <param> <value>

Specify the value of a global parameter. This assignment overrides any param statements in the scenario. If the given value can be interpreted as an int or float, it is; otherwise it is kept as a string.

The equivalent of this option for the Python API is the params argument to scenic.scenarioFromFile (which, however, does not attempt to convert strings to numbers).

-s <seed>, --seed <seed>

Specify the random seed used by Scenic, to make sampling deterministic.

This option sets the seed for the Python random number generator random, so external Python code called from within Scenic can also be made deterministic (although random should not be used in place of Scenic’s own sampling constructs in Scenic code). Note though that NumPy provides other RNGs whose seeds are not set by this option (see numpy.random).

--scenario <scenario>

If the given Scenic file defines multiple scenarios, select which one to run. The named modular scenario must not require any arguments.

The equivalent of this option for the Python API is the scenario argument to scenic.scenarioFromFile.

Dynamic Simulations

-S, --simulate

Run dynamic simulations from scenes instead of plotting scene diagrams. This option will only work for scenarios which specify a simulator, which is done automatically by the world models for the simulator interfaces that support dynamic scenarios, e.g. scenic.simulators.carla.model and scenic.simulators.lgsvl.model. If your scenario is written for an abstract domain, like, you will need to use the --model option to specify the specific model for the simulator you want to use.

--time <steps>

Maximum number of time steps to run each simulation (the default is infinity). Simulations may end earlier if termination criteria defined in the scenario are met (see terminate when and terminate).

--count <number>

Number of successful simulations to run (i.e., not counting rejected simulations). The default is to run forever.



Show which version of Scenic is being used.

-v <verbosity>, --verbosity <verbosity>

Set the verbosity level, from 0 to 3 (default 1):


Nothing is printed except error messages and warnings (to stderr). Warnings can be suppressed using the PYTHONWARNINGS environment variable.


The main steps of compilation and scene generation are indicated, with timing statistics.


Additionally, details on which modules are being compiled and the reasons for any scene/simulation rejections are printed.


Additionally, the actions taken by each agent at each time step of a dynamic simulation are printed.


Show values of global parameters for each generated scene.


Show recorded values (see record) for each dynamic simulation.

-b, --full-backtrace

Include Scenic’s internals in backtraces printed for uncaught exceptions. This information will probably only be useful if you are developing Scenic.


If an error occurs, enter the Python interactive debugger pdb. Implies the -b option.


If a scene/simulation is rejected (so that another must be sampled), enter pdb. Implies the -b option.