public interface BAModel extends NetworkModel
Defines an interface for the BarabasiAbert Network Model of preferential attachment.
You can either use the method configure(int, int, long)
present in the current interface or the general
configure
method from the NetworkModel
interface.
Injector injector = Guice.createInjector(new NetworkModule());
BAModel model = injector.getInstance(BAModel.class);
Configuration config = model.getConfiguration();
config.setProperty("numNodes", 1000);
config.setProperty("numLinks", 1);
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,
int d,
long seed)
Configures the model to be executed with a given number of nodes and a
number of links to be added with each new node addition
|
configure, generate, getConfiguration
void configure(int numNodes, int d, long seed) throws org.apache.commons.configuration.ConfigurationException
numNodes
- the number of nodesd
- number of links created each iteration of the network growthseed
- the random number generator seedorg.apache.commons.configuration.ConfigurationException