Reference 〉Decorator

@Helipad.event( str name = None, bool repeat = False,  **kwargs )

A function decorator used to register an Event. When triggered, an event stores the data output at that time and registers on the visualizer. TimeSeries, for example, draws a vertical line on the plots (see the image to the right), and Charts will flash the background. In the image to the right there are two events, marking the increase and leveling off of population.

This decorator can be used bare (i.e. without parentheses) on a function whose name will be used as the event name. It can also take arguments, which are passed to model.addEvent().

The decorated function will run at the end of each period, immediately after data collection but before the modelPostStep hook.

Parameters

  • name str, optional

    An optional reference name, to override the function name.

    Default value: None

  • repeat bool, optional

    Whether the event should trigger once, or every time the criterion is satisfied.

    Default value: False

  • **kwargs optional

    Further options to be passed to the visualizer's event() method. TimeSeries.event(), for example, draws a vertical line on the plot area, and takes color, linestyle, and linewidth arguments to customize its appearance.

    Default value: {}


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, 526) #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