Function cmb_event_queue_initialize

Function Documentation

void cmb_event_queue_initialize(double start_time)

Initialize the event queue itself. Must be called before any events can be scheduled or executed. Expects to find an empty event queue.

Call at the beginning of your simulation trial to start from a fresh state. Make sure to call cmb_event_queue_terminate at the end of your trial to free up space.

Note that there is no cmb_event_queue_create, _reset, or _destroy. There ìs only one (thread local) event queue per thread, no need to create another. Hence, no need for the usual self-pointer as the first argument to this function either, it acts on the one and only event queue in this thread.

Calling cmb_event_queue_initialize again on the next trial in the same worker thread without calling cmb_event_queue_terminate at the end of the previous trial will fire an assert about the event queue not being NULL in cmb_event_queue_initialize.

Parameters:
  • start_time – The starting value for the simulation clock, usually 0.