Reference 〉Function

Data.agentReporter( str key, str prim = None, str breed = None, str good = None, str stat = 'mean', list[int] percentiles = [], float std = None )

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, because agent.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 using Chart.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 using Chart.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).


Fatal error: Uncaught TypeError: Unsupported operand types: string - string in /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php:200 Stack trace: #0 [internal function]: {closure}(Object(WP_Comment), Object(WP_Comment)) #1 /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php(200): usort(Array, Object(Closure)) #2 /home/dh_nzhxm7/helipad.dev/wp-includes/class-wp-hook.php(294): {closure}(Array) #3 /home/dh_nzhxm7/helipad.dev/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array) #4 /home/dh_nzhxm7/helipad.dev/wp-includes/comment-template.php(1518): apply_filters('comments_array', Array, 146) #5 /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/single-hook.php(64): comments_template() #6 /home/dh_nzhxm7/helipad.dev/wp-includes/template-loader.php(106): include('/home/dh_nzhxm7...') #7 /home/dh_nzhxm7/helipad.dev/wp-blog-header.php(19): require_once('/home/dh_nzhxm7...') #8 /home/dh_nzhxm7/helipad.dev/index.php(17): require('/home/dh_nzhxm7...') #9 {main} thrown in /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php on line 200