
Create an AgentBasedModel instance
make_abm.Rd
Initializes an AgentBasedModel
with specified parameters
and agents
.
If parameters
is NULL
, the function constructs a ModelParameters
object
using any additional arguments (...
) passed to make_model_parameters()
.
Arguments
- parameters
A
ModelParameters
instance specifying model context. IfNULL
, parameters are created usingmake_model_parameters(...)
.- agents
A list of
Agent
objects, typically created separately. Optional.- ...
Additional arguments passed to
make_model_parameters()
ifparameters
isNULL
.
Examples
abm <- make_abm(n_agents = 10)
abm2 <- make_abm(parameters = make_model_parameters(n_agents = 10))
abm_g <- make_abm(graph = socmod::make_small_world(N = 20, k = 6, p = 0.2))
abm_g2 <- make_model_parameters(
graph = socmod::make_small_world(N = 20, k = 6, p = 0.2)
) %>% make_abm