newConfigurationModel | R Documentation |
Creates a random network using the configuration model
rng |
a function that generates random degrees |
The population must be an external pointer, not an R6 object To use an R6 object, we should use its pointer representation from its $get method.
The function rng should take exactly one argument n for the number of degrees to generate, and should return an integer vector of length n.
an external pointer.
# creates a simulation with 100 agents
sim = Simulation$new(100)
# add a Poisson network with a mean degree 5
sim$addContact(newConfigurationModel(function(n) rpois(n, 5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.