The Disease scenario was originally developed from the Basic scenario, though it is now quite different. But like Basic, it is straightforward and useful for illustrating HexSim mechanics. A video titled HexSim Disease Demo was constructed using the output from this model. This model can be thought of as having two principal components: demography and disease.
Unlike the Basic model, individuals from this population live in groups. The groups tend to reside within the habitat patches because the Population Parameters Range Data were set to preclude low quality habitat from being part of groups' ranges. The exact values of these parameters, for example the maximum group size or the stage-stratified resource targets, are not that critical. The basic population dynamics observed in the videos would still emerge if these parameters were altered.
For the non-disease elements of demography, the population really just depends on a single accumulated trait called Stage Class. A location trait is used principally for data gathering, but for simplicity this trait is also used in the vaccination scheme described below. The remaining traits are all tied to the disease components of the model.
The simulation begins with two events that illustrates how a population can be introduced into a map that doesn't exist in the workspace. These two events, Generated Hexmap and Introduction, are housed within the Model Initialization event group, which only triggers during the first time step. This initial Generated Hexmap event produces a map that is all zero except for a single hexagon at the center of patch 3. The subsequent Introduction event places 10 individuals into that single hexagon. The scenario's other introduction event, which initiates the disease epidemic, also makes use of this generated hexmap.
Within the Life Cycle Events event group, an Accumulate events increments each individual's age. Next, a Reproduction event adds new juveniles to the population. A subsequent Transition event is used to assign these offspring the infection status of their parent. Juveniles then disperse away from the natal group (this also aids in disease spread) but they are allowed to join any group that will accept them, including their natal group. A Survival event is then used to impose mortality based upon stage class.
Individuals in this model are either unexposed or exposed (in reality the amount of exposure may matter). The probabilistic trait is called Disease Status, and it has four trait values: Susceptible, Infected, Recovered, and Vaccinated.
The initial Accumulate event, and the subsequent two Event Groups are used to introduce the disease into the population, and to vaccinate some or all of the resource patches.
The timing of the disease introduction and vaccination are controlled by Global Variables. These Global Variables affect the status of a Scheduler population (consisting of a single individual), that in turn controls the operation of the two Event Groups via the Use Termination controls. Vaccination functions by moving individuals from the susceptible class into the recovered class.
Set Infection Outcome determines what will happen to each infected individual. Possible outcomes include (a) remain infected, (b) recover, and (c) die.
Prepare for Exposure clears the accumulator named Exposure Switch.
Compute Exposure marks as exposed each unexposed member of the susceptible class who shares an allocated area with an infected individual.
Set Exposure Outcome moves some exposed members of the susceptible class into the infected class. The rate at which exposed individuals become infected is supplied to the model as a Global Variable.
Disease Dynamics I updates the status of infected individuals.
Disease Dynamics II updates the status of susceptible individuals who have been exposed.
Disease Mortality removes infected individuals who transitioned into the "Died" class.
Free Unused Resources shrinks ranges that are tying up excess resources.
The Disease scenario includes two Census events, and it uses a Generated Hexmap event to construct maps illustrating the patterns of disease spread. All of these events are contained within the Event Group titled Map Disease Dynamics.
The Disease Dynamics generated Hexmap (see image to the right) illustrates how a small number of specific colors can be used to convey a precise set of conditions. In this case, the variables h1, h2, and h3 represent the habitat map score, the presence or absence of range hexagons, and the number of infected individuals. The generated Hexmap is constructed from four nested Cond() statements. Note that Cond (x, y, z) can be translated: If (x > 0) return y, else return z.
h1 = Infection status, written to each individual's accumulated area.
h2 = Each hexagon falling within a group's range is set to 1, otherwise 0.
h3 = The Habitat Map hexmap
says to set hexagons occupied by an infected individual to -2. Otherwise if the hexagon is part of a group's range (meaning it's occupied), set the value to +2. Otherwise if the hexagon has a score greater than 5 (meaning it is good habitat) set the value to +1. Otherwise if the hexagon is nonzero, set the value to -1. Otherwise set it to zero.
-2 -> occupied, infection. Blue.
-1 -> low quality habitat. Green.
0 -> non-habitat. Gray.
+1 -> high quality habitat. Yellow.
+2 -> occupied, no infection. Red.
When HexSim displays a Hexmap that has both negative and positive scores, it divides the color spectrum up into two equal parts, which it assigns to the ranges [min, 0) and (0, max]. This ensures that the five categories above will be assigned five distinct colors, as in the image above.
Disease Model Experiments
Introduce Disease (the time step in which the disease is added to the population).
Begin Vaccination (the time step at which vaccinations begin).
Infection Rate (the rate at which susceptible individuals exposed to the disease become infected.
Recovery Rate (the rate at which infected individuals move into the recovered class.
Mortality Rate (the rate at which infected individuals die).
Vaccinate Patch n (turns on vaccination in patch n when set to 1).
These Global Variables make it easy for users to run experiments by varying key disease-related parameters. The probability that an infected individual remains infected is 1.0 - (Recovery Rate + Mortality Rate). Increasing the infection or mortality rates can cause the disease to burn itself out, and thus drop out of the population. Recovered individuals never re-enter the susceptible population, and this allows the vaccination scheme to be extremely simple. The patches referenced by the nine Vaccinate Patch n variables can be viewed in the Habitat Patches hexmap. Once vaccination begins, it continues for the reminder of the simulation.
Naturally, users may change other elements of the Disease model beyond the Global Variables. An obvious example would involve altering the movement parameters.