Coder Social home page Coder Social logo

sirmodel's Introduction

SIR(S)感染症モデルシミュレータ

何奴

SIR感染症モデルをグリッドベースでシミュレートする物体です。クソ雑実装なのであしからず。

必要な環境

Python3.x系

Usage

$ python sir.pyで実行

使い方

  • clear set

    感染0(全て感受性保持)でキャンバスを作成。

  • random set

    ランダムな感染グリッドを持つキャンバスを作成。初期感染率は0.1%。

  • 再生・停止・巻き戻し

    それぞれに対応。

  • Grid

    グリッドの形を三角、四角から選択。

  • Model

    SIR, SIRSモデルから選択。

  • Prob

    ステップごとに隣接するグリッドへ感染する確率p。一般的な感染率は三角の場合 $$ \begin{eqnarray} 1 - (1 - p)^3 \end{eqnarray} $$ 四角の場合 $$ \begin{eqnarray} 1 - (1 - p)^4 \end{eqnarray} $$ で求められる。

  • Recover Time

    感染したグリッドが免疫を保持するまでのステップ数。

  • Restoration Time

    免疫を保持したグリッドが失うまでのステップ数。

  • Range File Name

    感染範囲を制限するファイル名を指定。無記入・ファイル名が見つからない場合は無視。

感染範囲指定について

上からy行目の値を$$x_m1 x_M1 x_m2 x_M2 \cdots x_mn x_Mn$$とすると、座標(x,y)は$$x_m1 < x < x_M1, x_m2 < x < x_M2, \cdots x_mn < x < x_Mn$$の範囲に含まれるならば感染有効とする。

sirmodel's People

Contributors

mimizunohimono avatar wtkmn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.