This repository contains an agent-based spatial SIR epidemic model where individuals occupy a two-dimensional periodic lattice and interact through oscillating interaction radii. Each agent is represented as a disc whose radius varies sinusoidally in time, creating a dynamically evolving contact network.
The model captures epidemic spreading driven by geometric overlap between neighboring oscillating discs and incorporates stochastic infection and recovery processes.
-
Agents are placed on an N × N square lattice with periodic boundary conditions.
-
Each agent has a time-dependent interaction radius:
R_i(t) = R₀ [1 + sin(ωt + φ_i)]
where φ_i is a spatial phase offset.
-
Two agents can transmit infection if their discs overlap.
-
Epidemic dynamics follow an SIR process:
- Susceptible → Infected with probability β
- Infected → Recovered with probability γ
-
A GIF animation is generated showing the spatio-temporal evolution of the epidemic.
Install the required R package:
install.packages("animation")