public interface NetworkModel
A network model can be seen as a Network
factory. Instances
of this interface should be able to create network instances based on
algorithms for constructing network topologies with a target set of
topological features.
Among such generative procedures, we can include simple or complex network models. Complex network models define ways to construct networks with non-trivial topological features that do not occur in simple networks such as lattices or random graphs but often occur in real graphs such as Online Social networks.
A NetworkModel
should provide a way to configure the network
generative procedure using the method
configure(Configuration)
. The specific details of each
configuration (such as parameter names) should be included within each
network model.
The network models are configured using Configuration
objects. These
should be provided by the network model implementations using the
getConfiguration()
method.
If you use the general configure method from the NetworkModel
interface, you could setup a model as follows:
Configuration config = model.getConfiguration();
config.setProperty("numNodes", 1000);
config.setProperty("numLinks", 2);
model.configure(config);
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.commons.configuration.Configuration configuration)
Configures the
NetworkModel with a given Configuration
instance. |
Network |
generate()
Generates a
Network instance. |
org.apache.commons.configuration.Configuration |
getConfiguration()
Returns a configuration object which can be used to set parameter values
for the network model.
|
org.apache.commons.configuration.Configuration getConfiguration()
Returns a configuration object which can be used to set parameter values
for the network model. After getting a configuration object and setting
the appropriate values, one can configure the model with the method
configure(Configuration)
.
void configure(org.apache.commons.configuration.Configuration configuration) throws org.apache.commons.configuration.ConfigurationException
Configures the NetworkModel
with a given Configuration
instance. Note that the configuration objects should be provided by each
network model instance and accessed using @
NetworkModel#getConfiguration()}.
configuration
- a configuration with the appropriate parameters for the
network model to run.org.apache.commons.configuration.ConfigurationException
- an exception that should be thrown if the passed
configuration contains an invalid configuration (missing
parameters or invalid parameter values)Network generate()
Network
instance. Note that this method should only
be called after the NetworkModel
is configured properly.
To correctly configure a model, you should refer to the documentation of
each model. The various models should supply enough information in their
documentation about what kind of parameters are expected and the valid
values for each parameter.