public class DefaultWSModel extends AbstractNetworkModel implements WSModel
Constructor and Description |
---|
DefaultWSModel(org.apache.commons.configuration.Configuration config,
org.apache.commons.math3.random.RandomGenerator random,
com.google.inject.Provider<Network> networkProvider,
KRegularModel regularModel) |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.commons.configuration.Configuration configuration)
Configures the
NetworkModel with a given Configuration
instance. |
void |
configure(int numNodes,
int k,
double p,
long seed)
Configures this model to generate a small-world network with a given
number of nodes.
|
generate, getConfiguration
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generate, getConfiguration
@Inject public DefaultWSModel(org.apache.commons.configuration.Configuration config, org.apache.commons.math3.random.RandomGenerator random, com.google.inject.Provider<Network> networkProvider, KRegularModel regularModel)
public void configure(org.apache.commons.configuration.Configuration configuration) throws org.apache.commons.configuration.ConfigurationException
NetworkModel
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()}.
configure
in interface NetworkModel
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)public void configure(int numNodes, int k, double p, long seed) throws org.apache.commons.configuration.ConfigurationException
WSModel
configure
in interface WSModel
numNodes
- number of nodes in the generated networkk
- minimum degree for the initial seed networkp
- re-wiring probability 0<=p<1 this is used to generate a
network between a k-regular network and a random network.seed
- the seed to be used in the random number generator of this
modelorg.apache.commons.configuration.ConfigurationException
- if the model is not correctly configured.