simulator
modeling and simulation of pandemic
The βmechanical partβ of the (Monte Carlo) model is a simplified model of (two-dimensional) Brownian motion. Balls move without friction inside the rectangle. Interaction occurs only when the balls collide with each other and / or with the border of the rectangle. The interaction is described as an elastic collision. The initial position, speed and direction of movement of each ball are random values (in certain limits).
"Mechanical" parameters of the model:
the diameter of each ball is 1 (constant),
the size of the rectangular area (where the balls move) - in the diameter of the ball,
minimum and maximum speed of the balls,
number of balls
simulated time (of movement of the balls).
Video demonstration of
vmPandeSimΒ
In addition, each ball has its own state: either βhealthyβ, or βsickβ, or βrecovered / vaccinatedβ, or βdeadβ.
Corresponding model parameters:
the probability of a βhealthyβ ball to become βsickβ (upon collision with a βsickβ ball),
the probability of a βrecovered / vaccinatedβ ball to become βsickβ (upon collision with a βsickβ ball),
the probability of a βsickβ ball to βrecoverβ, that is, to become βvaccinatedβ during the entire simulated time,
the probability of a βsickβ ball to βdieβ during the entire simulated time.
The change in the state of the balls occurs randomly in accordance with the given probabilities (Monte Carlo method).
- the main results are in text file with dependencies of quantities of healthy, sick etc vs simulated time. The format of the file:
L <name-of-data>
C
<time> <quantyty>
<time> <quantyty>
...
- additional data are in text files with trajectories of simulated balls (recommended for debug only)
Three modes for show results during the simulation (mode affects runtime)
1. Show progress only - the main and fastest mode
2. Show statistics - in addition to "progress only" draws main results (curves of quantities of healthy, sick etc) during the simulation; slower than progress only mode
3. Show movement - shows simulating balls in motion; slower than statistics mode; use it for video- testing and fun only π
For details see the Pandemic page