An element in a dynamically extended network class is considered to be either “active” or “inactive” at any point in time, with the substantive meaning of “activity” determined by the specific application context. The activate
and deactivate
functions provide an interface for controlling the state of the elements in a dynamic network.
activate.edges
and activate.vertices
have identical behavior, except for the elements they modify (the same is true for the deactivate.*
functions).
There are several ways to specify the activity spell, and the general syntax rules are described at activity.attribute
. Activity can be set for a single time point, using either at
, or by setting onset=terminus. Activity can be set for an interval [onset,terminus), using a valid combination of the onset
, terminus
and length
attributes.
This allows for a wide range of options when specifying spells, but a correct specification must use only one of these forms:
at
onset and terminus
onset and length
terminus and length
or, you can provide no timing information
If provided with no timing information, the element is activated/deactivated from -Inf
to Inf
.
The specified interval spans the period from the onset (inclusive) to the terminus (exclusive), so [onset,terminus).
There are some special behaviors associated with the arguments Inf
and -Inf
.
The open-ended interval c(-Inf,x)
includes -Inf
. For consistency, we also allow the open-ended interval c(x, Inf)
to include Inf
.
Thus [onset, terminus) will be interpreted as [onset, terminus] when terminus = Inf
.
The arguments Inf
or -Inf
are only valid when used to specify an interval, they can not be used
to specify status at a time point using at
. In addition, they cannot be paired with themselves in a call.
That is, both (Inf,Inf)
and (-Inf,-Inf)
are not valid specifications for any spell.
Both deactivate.*(x)
and deactivate.*(x, -Inf, Inf)
create the null spell -- specifying inactivity over the entire time span. Note that
by convention the null spell is stored as (Inf,Inf)
.
Calling the activation/deactivation functions with a vector of spell modifiers and a vector of elements to be modified
(for example, at=c(1,3,5 7), v=c(1:4)
) allows multiple elements in the network
to be activated/deactivated simultaneously (note, not multiple spells for a single element).
The spell modifiers are applied sequentially to the selected elements.
If the length of the spell vector is less than the number of elements,
the spell modifiers are recycled as needed.
When multiple network elements are activated in a single call, the spell modifiers must all be of one type,
either at
, or a valid mix of onset
, terminus
and length
.
The activate.*
and deactivate.*
functions in general modify spells in similar, if opposite, ways.
However, there are some behaviors that are specific to each function.
Currently, there is no support for activating multiple spells for a single element
in a single call. To activate 2 spells for a node, for example, one must call
activate.vertices twice. It is advisable to remove duplicate edges or
vertices from the e
or v
input vectors.
Edge/vertex activity is tracked through an attribute called (eponymously) “active”, and which is explained in more detail under activity.attribute. This may be modified or otherwise accessed using standard class methods (e.g., get.edge.attribute
), as well as the specialized methods described here.