A decorator to register a column in the data to be collected each period. The decorated function should take one argument, the model, and output a recordable value.
This decorator can be used bare (i.e. without parentheses), in which case the column name takes the name of the decorated function. Further arguments are passed to Data.addReporter()
.
Parameters
key — str, optional
The name of the data column, if overriding the function name.
Default value: None
smooth — int, optional
Replaces the series with a decaying average for the purposes of plotting. Higher values smooth the data more strongly. The original data is recorded in a new column with the same name but postfixed with
-unsmooth
.Default value: None
charwick
Aug 06, 2020 at 4:16This example registers a reporter to be placed in the column
'hsum'
.The column name can be changed without changing the name of the function by decorating with, e.g.,
@heli.reporter('sumofh') instead.