This is a ragged array which stores integers (numeric values).
get_values()Get the variable values.
indexoptionally return a subset of the variable vector. If
NULL, return all values; if passed an Bitset
or integer vector, return values of those individuals.
get_length()Get the lengths of the indiviudal elements in the ragged array
indexoptionally only get lengths for a subset of persons. If
NULL, return all lengths; if passed an Bitset
or integer vector, return lengths of arrays for those individuals.
queue_update()Queue an update for a variable. There are 4 types of variable update:
Subset update: The argument index represents a subset of the variable to
update. The argument values should be a vector whose length matches the size of index,
which represents the new values for that subset.
Subset fill: The argument index represents a subset of the variable to
update. The argument values should be a single number, which fills the specified subset.
Variable reset: The index vector is set to NULL and the argument values
replaces all of the current values in the simulation. values should be a vector
whose length should match the size of the population, which fills all the variable values in
the population
Variable fill: The index vector is set to NULL and the argument values
should be a single number, which fills all of the variable values in
the population.
valuesa list of numeric vectors
indexis the index at which to apply the change, use NULL for the
fill options. If using indices, this may be either a vector of integers or
an Bitset.
restore_state()restore the variable from a previously saved state.
timestepthe timestep at which simulation is resumed. This parameter's value is ignored, it only exists to conform to a uniform interface with events.
statethe 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.