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.


  • 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/ Stack trace: #0 [internal function]: {closure}(Object(WP_Comment), Object(WP_Comment)) #1 /home/dh_nzhxm7/ usort(Array, Object(Closure)) #2 /home/dh_nzhxm7/ {closure}(Array) #3 /home/dh_nzhxm7/ WP_Hook->apply_filters(Array, Array) #4 /home/dh_nzhxm7/ apply_filters('comments_array', Array, 526) #5 /home/dh_nzhxm7/ comments_template() #6 /home/dh_nzhxm7/ include('/home/dh_nzhxm7...') #7 /home/dh_nzhxm7/ require_once('/home/dh_nzhxm7...') #8 /home/dh_nzhxm7/ require('/home/dh_nzhxm7...') #9 {main} thrown in /home/dh_nzhxm7/ on line 200