Package: ABM 0.4.1

ABM: Agent Based Model Simulation Framework

A high-performance, flexible and extensible framework to develop continuous-time agent based models. Its high performance allows it to simulate millions of agents efficiently. Agents are defined by their states (arbitrary R lists). The events are handled in chronological order. This avoids the multi-event interaction problem in a time step of discrete-time simulations, and gives precise outcomes. The states are modified by provided or user-defined events. The framework provides a flexible and customizable implementation of state transitions (either spontaneous or caused by agent interactions), making the framework suitable to apply to epidemiology and ecology, e.g., to model life history stages, competition and cooperation, and disease and information spread. The agent interactions are flexible and extensible. The framework provides random mixing and network interactions, and supports multi-level mixing patterns. It can be easily extended to other interactions such as inter- and intra-households (or workplaces and schools) by subclassing an R6 class. It can be used to study the effect of age-specific, group-specific, and contact- specific intervention strategies, and complex interactions between individual behavior and population dynamics. This modeling concept can also be used in business, economical and political models. As a generic event based framework, it can be applied to many other fields. More information about the implementation and examples can be found at <https://github.com/junlingm/ABM>.

Authors:Junling Ma [aut, cre]

ABM_0.4.1.tar.gz
ABM_0.4.1.zip(r-4.5)ABM_0.4.1.zip(r-4.4)ABM_0.4.1.zip(r-4.3)
ABM_0.4.1.tgz(r-4.4-x86_64)ABM_0.4.1.tgz(r-4.4-arm64)ABM_0.4.1.tgz(r-4.3-x86_64)ABM_0.4.1.tgz(r-4.3-arm64)
ABM_0.4.1.tar.gz(r-4.5-noble)ABM_0.4.1.tar.gz(r-4.4-noble)
ABM_0.4.1.tgz(r-4.4-emscripten)ABM_0.4.1.tgz(r-4.3-emscripten)
ABM.pdf |ABM.html
ABM/json (API)
NEWS

# Install 'ABM' in R:
install.packages('ABM', repos = c('https://junlingm.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/junlingm/abm/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

4.73 score 27 stars 4 scripts 386 downloads 30 exports 2 dependencies

Last updated 7 months agofrom:cd4ab44bb4. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 15 2024
R-4.5-win-x86_64OKNov 15 2024
R-4.5-linux-x86_64OKNov 15 2024
R-4.4-win-x86_64OKNov 15 2024
R-4.4-mac-x86_64OKNov 15 2024
R-4.4-mac-aarch64OKNov 15 2024
R-4.3-win-x86_64OKNov 15 2024
R-4.3-mac-x86_64OKNov 15 2024
R-4.3-mac-aarch64OKNov 15 2024

Exports:addAgentAgentclearEventsContactEventgetAgentgetIDgetSizegetStategetTimegetWaitingTimeleavematchStatenewAgentnewConfigurationModelnewCounternewEventnewExpWaitingTimenewGammaWaitingTimenewPopulationnewRandomMixingnewStateLoggerPopulationschedulesetDeathTimesetStatesetStatesSimulationstateMatchunschedule

Dependencies:R6Rcpp

Readme and manuals

Help Manual

Help pageTopics
Agent Based Model Simulation FrameworkABM-package ABM
add an agent to a populationaddAgent
R6 class that represent an agentAgent
Unschedule all event from an agentclearEvents
An R6 class that implements a contact pattern in RContact
R6 class to create and represent an eventEvent
Get the agent at an index in the populationgetAgent
Get the ID of the agent.getID
Get the size of a populationgetSize
Get the state of the agentgetState
returns the event timegetTime
Generate a waiting time from an WaitingTime objectgetWaitingTime
leave the population that the agent is inleave
Check if the state of an agent matches a given statematchState
Create an agent with a given statenewAgent
Creates a random network using the configuration modelnewConfigurationModel
Create a logger of the Counter classnewCounter
Creates a new event in RnewEvent
Creates an exponentially distributed waiting timenewExpWaitingTime
Creates an gamma distributed waiting timenewGammaWaitingTime
Create a new populationnewPopulation
Creates a RandomMixing objectnewRandomMixing
Create a logger of the StateLogger classnewStateLogger
R6 class that represents a populationPopulation
Schedule (attach) an event to an agentschedule
set the time of death for an agentsetDeathTime
Set the state of the agentsetState
Set the state for each agent in a populationsetStates
R6 class Create and represent a Simulation objectSimulation
The state of an agentState
Check if two states matchstateMatch
Unschedule (detach) an event from an agentunschedule