Skip to content

Commit

Permalink
Description of modules and initalization
Browse files Browse the repository at this point in the history
  • Loading branch information
confunguido committed Aug 12, 2024
1 parent b1c2d95 commit 7a46e24
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions examples/basic_infection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ The purpose of this example is to model the infection process in a homogeneous p
- variables:
- population size: number of individuals to include in the simulation
- force of infection: rate at which susceptible individuals become infected
- infected period: time that an individual spends from infection to recovery

## Initialization
All individuals in the population are created with an infection property which is initialized as susceptible.
- infection duration: time that an individual spends from infection to recovery

## Simulation overview
The first infection attempt is scheduled at time 0. Infection events are scheduled to occur based on the constant force of infection. Once an infection event is scheduled, a susceptible individual is selected to be infected. After infection attempt is finished, the next infection event is scheduled based on the constant force of infection. The simulation ends after no more infection events are scheduled.
Expand All @@ -25,6 +22,20 @@ Infected individuals schedule their recovery at time `t + infected period`. The
flowchart LR
S(Susceptible) --FoI--> I(Infected) --inf. period--> R(Recovered)
```
## Simulation architecture
The simulation executaion first initializes the model parameters and prepares the simulation modules.

### Initialization and modules

- *parameters module*: this module manages data for parameter values for population size, force of infection, and infection duration. At initialization, all parameter variables are set to a specific value.
- *person module*: contains a unique ID for each person that identifies each person in the simulation.
- *person_infection_status module*: this module connects each person ID with a specific value for a person's infection status, which could be one of Susceptible, Infected, or Recovered.
- *population manager module*: The population manager module is in charge of setting up the population. At initialization, the module reads the population size (N) parameter and creates N persons with unique ids (1..N) and sets their initial infection status to Susceptible.
- *transmission module*: This module is in charge of spreading the infection through the population. At initialization, it schedules an infection attempt for time 0. An infection attempt consists of choosing at random a susceptible individual from the population and setting their infection status to **infected**.
- *infection manager module*: This module controls the infection status of each person. Specifically, it handles the progression of newly infected persons by scheduling recovery, which is drawn from an exponential distribution based on the infection duration parameter from the parameters module .
- *random_number_generator module*: Two random number generators are required. One to control the sequence of susceptible persons drawn in the transmission module, and another to control the specific times of recovery in the infection manager module.

### Control flow

### Events and observation
- Changes in the infection status of individuals release an event that are observed by the simulation context.
Expand Down

0 comments on commit 7a46e24

Please sign in to comment.