setEvents applies given values to events of the model depending on the key argument.

setEvents(
  key = NULL,
  name = NULL,
  trigger_expression = NULL,
  fire_at_initial_time = NULL,
  trigger_must_remain_true = NULL,
  priority_expression = NULL,
  delayed = NULL,
  delay_expression = NULL,
  assignment_target = NULL,
  assignment_expression = NULL,
  data = NULL,
  model = getCurrentModel()
)

Arguments

key

Identify which event to edit by specifying it's key, as string. Also supports fragments of keys, if uniquely matching one event.

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

List of assignment target entities (species, compartments, global quantities) per event to set, as list containing strings.

assignment_expression

List of assignment expressions per event to set, as list containing string, finite numeric, or logical.

data

A data frame as given by getEvents which will be applied before the other arguments.

model

A model object.

Details

Use the key argument to specify which event to modify and any of the other arguments to specify the value to set. The function is fully vectorized. If a NA value is supplied, the model value is kept unchanged.

The online article on managing model entities provides some further context.

See also

getEvents

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