{"id":16536093,"url":"https://github.com/algebra-fun/b-ca-infection-simulation","last_synced_at":"2026-06-09T10:31:20.276Z","repository":{"id":46052458,"uuid":"239768771","full_name":"Algebra-FUN/B-CA-Infection-Simulation","owner":"Algebra-FUN","description":"\"Brownian-CA-Infection\" is a Math Model of Infection based on CA and SIR.","archived":false,"fork":false,"pushed_at":"2021-11-17T14:46:53.000Z","size":16365,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T16:30:51.428Z","etag":null,"topics":["cellular-automaton","infection","mathmodel","mathmodeling","simulation","sir-model"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Algebra-FUN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-11T13:29:51.000Z","updated_at":"2021-11-17T14:46:58.000Z","dependencies_parsed_at":"2022-08-30T18:20:22.257Z","dependency_job_id":null,"html_url":"https://github.com/Algebra-FUN/B-CA-Infection-Simulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Algebra-FUN/B-CA-Infection-Simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Algebra-FUN%2FB-CA-Infection-Simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Algebra-FUN%2FB-CA-Infection-Simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Algebra-FUN%2FB-CA-Infection-Simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Algebra-FUN%2FB-CA-Infection-Simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Algebra-FUN","download_url":"https://codeload.github.com/Algebra-FUN/B-CA-Infection-Simulation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Algebra-FUN%2FB-CA-Infection-Simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cellular-automaton","infection","mathmodel","mathmodeling","simulation","sir-model"],"created_at":"2024-10-11T18:29:40.067Z","updated_at":"2026-06-09T10:31:20.260Z","avatar_url":"https://github.com/Algebra-FUN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 布朗-SIR-元胞自动机\n\n## 关于\n\n这是一种传染病模型，基于SIR，元胞自动机（CA）原理\n\n## 实验效果\n\n![](./img/50days.gif)\n\n![](./img/100days.gif)\n\n## 模型原理\n\n### SIR\n\n参考SIR模型，将人群分为3个组成部分\n\n* S(Susceptible)-易感人群\n* I(Infected)-感染人群\n* R(Removed)-移除人群\n\n性质\n1. 感染者（I）具有感染易感者（S）的能力\n2. 感染者（I）具有转化为移除者（R）的趋势\n3. 移除者（R）将不再具备传染能力\n\n### 布朗-元胞自动机（B-CA）\n\n基于元胞自动机（CA）模型，增加元胞（Cell）在空间内做布朗运动，以模拟人口区域范围流动性\n\n### 元胞空间\n\n#### 参数\n\n##### 布朗运动速度（v）\n\n* 代表布朗运动强度\n* 反应`人口流动强度`\n\n##### 空间大小（D）\n\n* 代表元胞所在空间的尺度\n* 反应`人口密度`\n\n### 运行机制\n\n分为3个步骤：\n\n1. move-元胞运动\n2. infect-传染\n3. remove-移除\n\n#### move-元胞运动\n\n$$\n(\\frac{dx}{dt})^2 + (\\frac{dy}{dt})^2 = v\n$$\n\n$$\n\\theta = random[0,2\\pi)\n$$\n\n#### infect-传染\n\n感染者（I）感染易感者（S）的过程\n\n感染概率$\\alpha$与感染者（I）和易感者（S）之间的距离$d$成正比\n\n第$i$个易感者$S_i$被第$j$个感染者$I_j$感染概率$\\alpha$可表示为\n$$\n\\alpha(S_i,I_j)= \\large{e^{-\\kappa\\cdot d(S_i,I_j)}}\n$$\n$$\n\\kappa\u003e0,d\\geq0 \\Rightarrow -\\kappa\\cdot d\\leq0\\Rightarrow 0\u003ce^{-\\kappa\\cdot d(S_i,I_j)} \\leq1\\Rightarrow \\alpha\\in(0,1]\n$$\n\n其中$\\kappa$为传染概率系数，$d(S_i,I_j)$表示第$i$个易感者$S_i$被第$j$个感染者$I_j$之间的距离\n\n则第$i$个易感者$S_i$被感染的概率为\n$$\n\\alpha(S_i)=1-\\prod_j\\alpha(S_i,I_j)\n$$\n\n#### remove-移除\n\n每天感染者（I）的被移除概率$\\beta$为一常数\n\n则感染者在被感染后第$k$天被移除的概率$\\gamma(k)$为\n$$\n\\gamma(k)=\\beta(1-\\beta)^{k-1}\n$$\n\n## Python Dependency\n\n1. numpy\n2. pandas\n3. matplotlib\n4. imageio\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgebra-fun%2Fb-ca-infection-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgebra-fun%2Fb-ca-infection-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgebra-fun%2Fb-ca-infection-simulation/lists"}