public interface DynamicNetwork extends Network
Defines a network / graph data structure that contains Nodes with
connections between them called edges or Links. It has the same
interface as a Network
with additional elements to allow to
model change over discrete time. What this means is that we can keep track of
nodes, links, node values and link values over time in the same network
structure.
DynamicNetwork
instances are created with one time instance by
default. This is t = 0 or t = getFirstTime()
if you
prefer. You can use the network as you would use the Network
interface.
If we wish to create another instant in time for the network, we can just use
setCurrentTime(int)
with the desired value (for
example 1, 2, 50, ..., etc). Whenever
setCurrentTime(int)
is used with a given value for
t, if this time instance does not yet exist, it is initialised with a
copy of the network state from the time instance immediately before the given
t.
As an example, if your network contains the time instances {0, 1, 2}, and you
use setCurrentTime(int)
with t = 3, the new time
instance will contain a network with a deep copy of t = 2.
Just like with Network
, you can get dynamic network instances as
follows:
Injector injector = Guice.createInjector(new NetworkModule());
Network network = injector.getInstance(Network.class);
Modifier and Type | Method and Description |
---|---|
int |
getCurrentTime()
Returns the current time instant in which you are working
|
int |
getFirstTime()
Returns the first time instant of this network
|
int |
getLastTime()
Returns the last time instant of this network
|
java.util.Set<? extends java.lang.Integer> |
getTimeInstances()
Returns the set of time instances for which there are events of node /
link insertion, etc.
|
void |
setCurrentTime(int t)
Sets the current instance of this network to a given discrete time t.
|
addLink, addLink, addNode, containsDirectedLink, containsLink, containsLink, containsNode, createLink, createNode, getInLinks, getLink, getLink, getLinkCount, getLinks, getLinks, getNeighbours, getNeighbours, getNode, getNodeCount, getNodes, getNodes, getNodes, getOutLinks, getPredecessors, getSuccessors, removeLink, removeLink, removeNode, removeNode
void setCurrentTime(int t)
t
- a discrete time with t >= 0int getCurrentTime()
int getLastTime()
int getFirstTime()
java.util.Set<? extends java.lang.Integer> getTimeInstances()