{"id":26201927,"url":"https://github.com/dmnfarrell/btbabm","last_synced_at":"2026-04-14T18:31:52.675Z","repository":{"id":153044850,"uuid":"604328030","full_name":"dmnfarrell/btbabm","owner":"dmnfarrell","description":"Agent based model for bovine TB spread in herds","archived":false,"fork":false,"pushed_at":"2023-11-21T10:35:43.000Z","size":13246,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T03:28:16.129Z","etag":null,"topics":["agent-based-modeling","bovine-tb","epidemiology"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmnfarrell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-20T20:33:45.000Z","updated_at":"2023-04-12T04:26:10.000Z","dependencies_parsed_at":"2023-11-04T13:24:20.313Z","dependency_job_id":null,"html_url":"https://github.com/dmnfarrell/btbabm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmnfarrell/btbabm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnfarrell%2Fbtbabm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnfarrell%2Fbtbabm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnfarrell%2Fbtbabm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnfarrell%2Fbtbabm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmnfarrell","download_url":"https://codeload.github.com/dmnfarrell/btbabm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnfarrell%2Fbtbabm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31810737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-based-modeling","bovine-tb","epidemiology"],"created_at":"2025-03-12T03:24:22.513Z","updated_at":"2026-04-14T18:31:52.659Z","avatar_url":"https://github.com/dmnfarrell.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=logo.png width=150px\u003e\n\n# bTBabm - Agent based model for bovine TB spread in herds.\n\nThis 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.\n\n## Parameters\n\nTimes are given in days since each step is a day.\n\n* mean_stay_time - mean time in a herd\n* mean_inf_time - mean infection time\n* mean_latency_time - mean latency time when not infectious\n* cctrans - cow-cow transmission prob\n* bctrans - badger-cow transmission prob\n* infected_start - how many cows to infect at start\n* mean_inf_time - mean infection time length before death\n* mean_stay_time - mean time on farm\n* seq_length - sequence length for simulating strains/mutations\n* herd_class - type of herd\n\n## Installation\n\nIf you want to try this out, the easiest way is to install with pip:\n\n`pip install -e git+https://github.com/dmnfarrell/btbabm.git#egg=btbabm`\n\n## Usage\n\nIn Python you can run the model as follows:\n\n```python\nfrom btbabm import models\nfrom btbabm import utils\n\nmodel = models.FarmPathogenModel(F=30,C=800,S=10,mean_inf_time=20,mean_stay_time=150,\n                       cctrans=0.01,seq_length=100,graph_seed=4)\n#run 100 steps\nfor s in range(100):\n  model.step()\n\n#equivalent code with progress bar\nmodel.run(100)\n\n#get state data\ndf = model.get_column_data()\n#get data for infected animals\ndf = model.get_infected_data()\n#plot the grid/network\nfig,ax=plt.subplots(1,1,figsize=(10,6))\nutils.plot_grid(model,with_labels=True,ns='perc_infected',ax=ax)\n```\n\n## Dashboard\n\nThere is a panel dashboard for experimenting with the model. It can be run by executing the `dashboard.py` module.\n\n\u003cimg src=img/dash_scr.png width=600px\u003e\n\n## References\n\n* [Mesa](https://mesa.readthedocs.io/)\n* [Individual-based model for the control of Bovine Viral Diarrhea spread in livestock trade networks](https://www.sciencedirect.com/science/article/pii/S0022519321002393?via%3Dihub)\n* [A Practical Introduction to Mechanistic Modeling of Disease Transmission in Veterinary Science](https://www.frontiersin.org/articles/10.3389/fvets.2020.546651/full)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnfarrell%2Fbtbabm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmnfarrell%2Fbtbabm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnfarrell%2Fbtbabm/lists"}