Skip to content

dmnfarrell/btbabm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bTBabm - Agent based model for bovine TB spread in herds.

This is a Python package that simulates Bovine TB spread amongst herds and badgers. It uses the Mesa package for implementing an Agent based model. This code is experimental and for research purposes only. Code may be subject to significant change.

Parameters

Times are given in days since each step is a day.

  • mean_stay_time - mean time in a herd
  • mean_inf_time - mean infection time
  • mean_latency_time - mean latency time when not infectious
  • cctrans - cow-cow transmission prob
  • bctrans - badger-cow transmission prob
  • infected_start - how many cows to infect at start
  • mean_inf_time - mean infection time length before death
  • mean_stay_time - mean time on farm
  • seq_length - sequence length for simulating strains/mutations
  • herd_class - type of herd

Installation

If you want to try this out, the easiest way is to install with pip:

pip install -e git+https://github.com/dmnfarrell/btbabm.git#egg=btbabm

Usage

In Python you can run the model as follows:

from btbabm import models
from btbabm import utils

model = models.FarmPathogenModel(F=30,C=800,S=10,mean_inf_time=20,mean_stay_time=150,
                       cctrans=0.01,seq_length=100,graph_seed=4)
#run 100 steps
for s in range(100):
  model.step()

#equivalent code with progress bar
model.run(100)

#get state data
df = model.get_column_data()
#get data for infected animals
df = model.get_infected_data()
#plot the grid/network
fig,ax=plt.subplots(1,1,figsize=(10,6))
utils.plot_grid(model,with_labels=True,ns='perc_infected',ax=ax)

Dashboard

There is a panel dashboard for experimenting with the model. It can be run by executing the dashboard.py module.

References

About

Agent based model for bovine TB spread in herds

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published