Adds a fast-spreading pathogen model with quarantine and compliance#359
Adds a fast-spreading pathogen model with quarantine and compliance#359
Conversation
fd41d91 to
9191f55
Compare
|
Thanks for the PR, looks like an interesting model. Could you:
|
for more information, see https://pre-commit.ci
6b1d69a to
d1c1a79
Compare
eb3e620 to
8276b8b
Compare
b8d7e32 to
e5e5d36
Compare
|
Peer Review — Pathogen Outbreak & Quarantine Compliance Model Reviewed Overall The two-threshold quarantine hysteresis is a genuinely interesting mechanic most epidemic examples use a single threshold and get oscillating quarantine on/off behaviour. The compliance + flee behaviour is well thought out and the four-screenshot README is one of the clearest I've seen for demonstrating parameter sensitivity. A few correctness issues before merge. Critical: Non-seeded RNG throughout import random
...
self.compliant = random.random() < self.model.compliance_rate
if random.random() > 0.40:
self.state = "infected"
chance_of_death = random.random()Every stochastic decision uses Python's global Missing package structure
O(n) infected-position scan inside every compliant agent's for i in self.model.agents:
if i.state == "infected":
infected_pos.append(i.cell.coordinate)Every compliant healthy agent scans all agents to find infected positions each step. With 300 agents during quarantine, this is O(n²) per step. A simple fix: cache README says MultiGrid, code uses
The model uses Dead agents block movement Dead agents remain on the grid (intentional, per README) but since
graph_ot = make_plot_component(["healthy", "infected", "immune", "dead", "quarantine"])
Summary The model concept is strong and the README is excellent. The two things that need fixing before merge: (1) replace all |
26d8520 to
f100519
Compare
for more information, see https://pre-commit.ci
Thanks for the review, really appreciate it. I fixed the two critical issues i.e I restructured the files into a proper package directory and used mesas own random function for proper seeding. Also added a note about dead agents blocking movement to the README file. Once again thanks for the review |
Pathogen Outbreak and Quarantine Compliance Model
Adds a fast-spreading pathogen model with automatic
quarantine and with it compliance rate mechanics.
Resolves #356
Mesa features used
Mesa version
4
How to run
pip install -r requirements.txt
solara run app.py
@jackiekazil @EwoutH
Demo of no compliance model