powered by
Creates a random network using the configuration model
an external pointer.
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.
# 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)))
Run the code above in your browser using DataLab