- Description
- Load challengeABM
- Run the simulation
- Within-Host Dynamics
- Status of Individual Animals
- Iterate
The challangeABM package includes the simulate_room_to_room() function for simulating virus transmission between 18 head of cattle. At simulation start, cattle (agents) are divided among five isolated rooms, with two donor cattle in Room 1, and four cattle in each of the other rooms, Rooms 2-5. On simulation hour 1, the two donor cattle are inoculated by a virus. The donor cattle remain isolated from other cattle for a 24hr period, then at the 24hr mark, the donor cattle (now infected) are moved to Room 2. At the next 24hr interval (48 hours since start of simulation), the donor cattle leave Room 2 and proceed to Room 3, where they remain for a 24hr period. The process continues with donors moving to Room 4 at 72hrs and Room 5 at 96hrs.
Depending on the quantity of virus in the donor cattle, they may or may not infect others. The quantity of virus in nasal passages and in blood serum has been calibrated to replicate like Foot-and-Mouth Disease Virus (FMDV).
The status of individual cattle virus loads, clinical presentation, and other factors are recorded on an hourly basis.
Virus and cattle parameters may be specified in configuration files to simulate changes to infectivity and virulence. Eventually, simulate_room_to_room() will be updated to allow changes in time intervals (minutes, hours, days,…), the number of rooms, and the number of animals in each room.
Hide code
library(challengeABM)
First, set random seed for reproducible runs.
Hide code
seed_val <- round(runif(1, 100, 300),0)
seed_val
[1] 139
Hide code
set.seed(seed_val)
Run the simulation based using a configuration file with needed parameters..
Hide code
model_result <- simulate_room_to_room(here("config/default_R2R_config.yaml"))
View change in nasal and virus quantities within individual animals.
Hide code
plot_virus_loads_R2R(model_result)
View the disease status of individual animals.
Hide code
plot_animal_status(model_result)
Additional function for multiple iterations.
Hide code
iterate_R2R(simulate_room_to_room, # function
config_file = here("config/default_R2R_config.yaml"), # settings to run
num_iterations = 50, # total iterations
write_interval = 10, # write to csv every write_interval
output_directory = here("local/test"), # where to write
use_parallel = TRUE, num_cores = 8
)