For custom progress reporting (e.g. graphical output, writing to a file, etc.),
the report keyword accepts a callable (i.e. a function or an object with a
__call__ method) that will be called with four parameters:

elapsed: the total (real) time since the start of the run

completed: the fraction of the total simulation that is completed,
i.e. a value between 0 and 1

start: The start of the simulation (in biological time)

duration: the total duration (in biological time) of the simulation

The function will be called every report_period during the simulation, but
also at the beginning and end with completed equal to 0.0 and 1.0,
respectively.

For the C++ standalone mode, the same standard options are available. It is
also possible to implement custom progress reporting by directly passing the
code (as a multi-line string) to the report argument. This code will be
filled into a progress report function template, it should therefore only
contain a function body. The simplest use of this might look like: