MGDrivE 2 is a new simulation platform which extends capabilities from the MGDrivE simulation package in a new mathematical and computational framework. For more information about MGDrivE, see our publication. Some of the notable capabilities of MGDrivE 2 include incorporation of human populations, epidemiological dynamics, time-varying parameters, and a continuous-time simulation framework with various sampling algorithms for both deterministic and stochastic interpretations.
The design feature that has made it possible to include a rich set of functionality into MGDrivE 2 is using a Petri net (PN) formalism to structure the software. By separating how a model is specified (state space, and events that are allowed to change state), and numerical methods which draw trajectories from a model, numerical methods in MGDrivE 2 are independent of any particular model, as long as it is expressed as a PN. Additionally, the well understood PN formalism, based on a bipartite graph describing how states and events are allowed to affect one another, means that quickly adding new features (such as human populations) can be done without needing to rewrite large parts of the existing codebase.
When assigning to each event a function that gives the current rate that event will occur (fire) at, given the present state and time, and assuming the Markov property, the simulation becomes a continuous-time Markov chain, and the PN is referred to as a stochastic Petri net (SPN). If we assume that rather than describing exponentially distributed random variables, those rate functions describe deterministic (continuous) rates of events firing, the SPN mathematically becomes a set of ordinary differential equations (ODE). In either case we can rely on the wealth of algorithms developed for solving ODEs or simulating CTMCs.
MGDrivE 2 uses the cube data structure from MGDrivE (CRAN link) to parameterize genetic inheritance.
There are a large number of vignettes included in MGDrivE 2 to describe its functionality. Aa a suggestion, we recommend new users to read them in the following rough order to acquaint themselves with the software.