newEvent creates a new event.

newEvent(
  name,
  trigger_expression,
  fire_at_initial_time = FALSE,
  trigger_must_remain_true = TRUE,
  priority_expression = NULL,
  delayed = c("no", "assignment", "calculation"),
  delay_expression = NULL,
  assignment_target = NULL,
  assignment_expression = NULL,
  model = getCurrentModel()
)

Arguments

name

Name to set, as string.

trigger_expression

Trigger expression to set, as string, finite numeric, or logical.

fire_at_initial_time

Whether to fire at initial time if true, as logical.

trigger_must_remain_true

Whether the trigger must remain true, as logical.

priority_expression

Priority expression to set, as string, finite numeric, or logical.

delayed

Whether the event assignment and / or calculation is to be delayed ("no", "assignment", "calculation"), as string.

delay_expression

Delay expression to set, as string, finite numeric, or logical.

assignment_target

Assignment target entities (species, compartments, global quantities), as character vector.

assignment_expression

Assignment expressions per event to set, as character, finite numeric, or logical vector.

model

a model object

Value

event key

Details

Default initial value is 1. Arguments priority from lowest to highest is initial_value, initial_expression.

The online article on model building provides some further context.

See also

Other event functions: deleteEvent(), entity_finders, getEvents(), setEvents()