Skip to contents

This class encapsulates the model's agents, the network that structures their interactions, static or dynamic model parameters, model state, and model outputs.

Public fields

agents

Named list of agents

n_agents

Number of agents

step

Time step integer index

network

Social network that structures agent interactions

params

Model parameters for use in partner selection, interaction functions, and

output

Model output, which is either initiated or appended to depending on if the model has been run yet. Create a new agent-based model.

Methods


Method new()

Agent-based models may be initialized one of three ways: (1) by providing the agents and the social network that structures their interaction; (2) providing only the social network; or (3) provide the number of agents only, which will create and add them to a complete graph.

Usage

AgentBasedModel$new(agents = NULL, network = NULL, n_agents = NULL, ...)

Arguments

agents

List of agents in agent-based model.

network

igraph Graph instance representing the ABM social network

n_agents

Number of agents.]

...

Additional kwargs that become entries in the AgentBasedModel$params field

Returns

self New agent-based model initialized as specified. Add agents to the model.


Method add_agents()

Usage

AgentBasedModel$add_agents(agents_to_add)

Arguments

agents_to_add

Insert a list of new agents into list of existing agents. Get an agent from the model by name.


Method get_agent()

Usage

AgentBasedModel$get_agent(name)

Arguments

name

Name of agent, usually an integer or string


Method clone()

The objects of this class are cloneable with this method.

Usage

AgentBasedModel$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.