Generates a reporter function that takes the model object and returns a summary statistic over all the values of an agent property.
Parameters
key — str, required
The name of the agent property the generated function should summarize.
prim — str, optional
The agent primitive whose properties should be gathered. A value of
None
will select the first primitive in order, usually'agent'
unless that primitive has been removed or reordered.Default value: None
breed — str, optional
Whether to limit the statistic to a particular breed.
Default value: None
good — str, optional
The
good
argument can be used to specify a dict key if the property is a dict of values rather than a numeric value itself. For example, becauseagent.goods
is a dict, the good name would need to be specified here in order to return inventories of a specific good.Default value: None
stat — str, optional
The summary statistic to be reported. Possible values are
'mean'
,'sum'
,'gmean'
(for geometric mean),'std'
(for standard deviation), or'percentile-nn'
, where nn is a number from 0-100. (Note this last option would be to record only the percentile statistic. Percentiles can be drawn alongside a main statistic using the following argument)Default value: 'mean'
percentiles — list[int], optional
Augments the reporter with percentiles corresponding to the list values. If drawn using
Plot.addSeries
, the percentiles will show as lighter and dotted lines on the same plot alongside the main series, or as error bars if drawn usingChart.addBar
and if there are two list items. The percentiles will also be recorded as new columns in the data with the same name, postfixed by-nn-pctile
.Default value: []
std — float, optional
Augments the reporter with two additional reporters for the mean ± some multiple of the standard deviation. If drawn using
Plot.addSeries
, the bounds will be drawn as lighter and dotted lines on the same plot alongside the main series, or as error bars if drawn usingChart.addBar
.Default value: None
Return Value — func(Model)|tuple(func(model),list[func])
A function that takes the model object and returns a numeric value, or a tuple with the first element being such a function, and the second being a list of subplot functions (e.g. for percentiles or ± standard deviations).