What is FRED?¶
FRED is a simulation engine for executing agent-based models. The FRED Modeling Language™ represents the programming language portion of the FRED ecosystem. The Epistemix Platform represents the broader simulation environment provided by Epistemix for simulating FRED models to see how a population of agents changes over time.
A typical population of agents representing individual people at a county-level. During a simulation, interesting emergent behavior can occur. Examples of changes to the population as a whole include updates to the population’s overall size (through birth and death) and changes to the age structure of the population (how many people there are in each age group).
A FRED model is broken down into conditions and states. Conditions might include diseases, behaviors, attitudes, economic status, or just about any other kind of condition a modeler wants to simulate and study. We'll dive more into how this works later, but note that one of the most interesting behaviors to observe in a simulation is often just how many people - and precisely which people - are in a certain state within a condition at a given time. FRED enables users to explore a wide range of conditions and how they spread within a population over time.
FRED is a tool that can be used for building epidemiological models. Wikipedia calls epidemiology "the study and analysis of the distribution (who, when, and where), patterns and determinants of health and disease conditions in defined populations." Epidemiology also traditionally includes health-related conditions such as obesity, drug use, etc., but there exists a casual and non-technical use of the term where epidemiology encompasses the study of any pattern that can spread in a population.
For example, one may speak of the epidemic of gun violence, the epidemic of panic, or the epidemic of social media use. With this definition, the term epidemic refers to any rapidly increasing patterns in a population (see examples in Malcolm Gladwell’s book, The Tipping Point). FRED lets us study the dynamics of epidemics by tracking how such patterns in populations vary over time and space.
Indeed, FRED has been used (and was originally designed to simulate) the spread and prevalence of infectious and noninfectious diseases, but has evolved to offer a much broader spectrum of functionalities, demonstrating its versatility and wide-ranging applicability.
Design Goals of FRED¶
There are many alternatives to building an agent-based model. Any large software system is designed with specific objectives in mind. These goals have had a significant impact on why FRED works the way it does.
Efficiency with Large Populations¶
FRED is designed to simulate interactions among a large population of agents as quickly as possible. The early applications of FRED were in the field of modeling infectious disease epidemics in areas with very many agents, such as US cities, counties, and states. To do so, we needed a system that could represent millions of individuals and their potential interactions in a reasonable amount of time.
Realistic Population Models¶
Because we are motivated to provide decision makers with simulations of epidemics in particular locations, FRED was designed take full advantage of synthetic populations that include both individuals and their mixing groups, including households, neighborhoods, schools, and workplaces, and a set of default behaviors for said individuals.
Tracks Conditions at the Population Level¶
One goal of FRED is to be capable of tracking the spread of conditions within a population. The output includes summary statistics of how many people are in a given state during each day of the simulation. The output can also include reports showing the location of these individuals. This information can be easily used to automatically generate useful graphics that show the spread of conditions over time and space.
FRED can also provide data on specific agents in the simulation. It can optionally record a kind of electronic health record (EHR) for each individual that includes every change to that individual’s state over time. A set of tools are available for searching this EHR dataset, or if desired, users can use it the data as input to an external analysis tool of their choosing.
Limited Active Set of Agents¶
FRED works most efficiently if there is a limited set of actively changing agents. The internal bookkeeping methods in FRED attempt to limit as much computation as possible to the active set of agents and those agents who may directly interact with the active set. Other agents are updated on an as-needed basis. For models in which a small subset of a large population is in the active set, FRED can produce dramatic speedups compared to simpler approaches that update each agent at each time step.
Reproducibility¶
FRED simulations are automatically provided with a randomly generated seed. If desired, this seed can be re-used should there be a need to re-run a model. Given an identical model with identical parameters and an identical seed, FRED will produce the same result.
Sweeps using multiple randomly generated seeds can also be performed in order to see how random chance affects a given model.
Extensibility¶
FRED permits modelers to design models that are quite complex. FRED models can track any number of conditions spreading through a population. The characteristics of each condition are defined by the user. The evolution of each agent’s state may depend on a wide range of factors, for example, the agent’s demographics, its social interactions, and the state of other agents in the model.