Describes a targeted event in the simulation.
This is useful for events which are triggered for a sub-population.
Methods
Inherited methods
Method new()
Initialise a TargetedEvent.
Arguments
population_size
the size of the population.
Method schedule()
Schedule this event to occur in the future.
Usage
TargetedEvent$schedule(target, delay)
Arguments
target
the individuals to pass to the listener, this may be
either a vector of integers or a Bitset.
delay
the number of time steps to wait before triggering the event,
can be a scalar in which case all targeted individuals are scheduled for
for the same delay or a vector of values giving the delay for that
individual.
Method get_scheduled()
Get the individuals who are scheduled as a Bitset.
Usage
TargetedEvent$get_scheduled()
Method clear_schedule()
Stop a future event from triggering for a subset of individuals.
Usage
TargetedEvent$clear_schedule(target)
Arguments
target
the individuals to clear, this may be either a vector of integers or
a Bitset.
Method queue_extend()
Extend the target size.
Usage
TargetedEvent$queue_extend(n)
Arguments
n
the number of new elements to add to the index.
Method queue_extend_with_schedule()
Extend the target size and schedule for the new population.
Usage
TargetedEvent$queue_extend_with_schedule(delays)
Arguments
delays
the delay for each new individual.
Method queue_shrink()
Shrink the TargetedEvent.
Usage
TargetedEvent$queue_shrink(index)
Arguments
index
the individuals to remove from the event.
Method .process_listener()
Usage
TargetedEvent$.process_listener(listener)
Method .process_listener_cpp()
Usage
TargetedEvent$.process_listener_cpp(listener)
Method save_state()
save the state of the event
Usage
TargetedEvent$save_state()
Method restore_state()
restore the event from a previously saved state.
Usage
TargetedEvent$restore_state(timestep, state)
Arguments
timestep
the timestep at which simulation is resumed.
state
the previously saved state, as returned by the
save_state
method. NULL is passed when restoring from a saved
simulation in which this variable did not exist.
Method clone()
The objects of this class are cloneable with this method.
Usage
TargetedEvent$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.