newConfigurationModel {ABM} | R Documentation |
Creates a random network using the configuration model
Description
Creates a random network using the configuration model
Arguments
rng |
a function that generates random degrees |
Details
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.
Value
an external pointer.
Examples
# 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)))
[Package ABM version 0.4.1 Index]