public interface BAForestModel extends NetworkModel
Defines an interface for the BarabasiAbert Network Model of preferential
attachment. This model is an efficient version of BAModel
using only
the parameter d = 1. This means that each time a node is added to the
network, only one link is created with preferential attachment. This process
thus creates a connected forest graph / network. A forest is basically an
acyclic graph.
You can either use the method configure(int, long)
present in
the current interface or the general
configure
method from the NetworkModel
interface.
Injector injector = Guice.createInjector(new NetworkModule());
BAForestModel model = injector.getInstance(BAForestModel.class);
Configuration config = model.getConfiguration();
config.setProperty("numNodes", 1000);
config.setProperty("seed", 0);
try{
model.configure(config);
}catch(ConfigurationException e){}
Network network = model.generate();
Modifier and Type | Method and Description |
---|---|
void |
configure(int numNodes,
long seed)
Configures the model to be executed with a given number of nodes and a
seed for the random number generator.
|
configure, generate, getConfiguration
void configure(int numNodes, long seed) throws org.apache.commons.configuration.ConfigurationException
numNodes
- the number of nodes to be createdseed
- the random number generator seedorg.apache.commons.configuration.ConfigurationException