Registers a column in the data to be collected each period. Typically used in conjunction with the various reporter methods of
Data, but user functions can also be used with the
key — str, required
A unique name to refer to the column.
func — func(Model), required
A reporter function (such as one generated by
data.agentReporter()) that takes one argument, the
modelobject, and returns a value to be entered in that period's row of the column.
smooth — int, optional
Replaces the series with a decaying average for the purposes of visualization. Higher values smooth the data more strongly. The original data is recorded in a new column with the same name but postfixed with
Default value: None
Return Value — Reporter
The newly created
Reporter object. This object can also be accessed after the fact at
Notes and Examples
charwickAug 06, 2020 at 4:50
Often reporter functions can be generated automatically. This line uses
Data.agentReporter()to generate a reporter function that saves the average of the
'store'-primitive agents to the
'wage'column of the data.
Reporters can also be lambda functions.
Or regular functions (though in this case, the
@reporterdecorator is typically easier).