Simulation of the SIRS model in CA with D3.js

In Chapter 7, Predicting Gold Prices, we already studied the basics of a random walk simulation. In this chapter, we will implement a CA in JavaScript using D3.js to simulate the SIRS model.

In the following screenshot, we can see the interface of our simulator. It's a simple interface with a 15x15 grid of cells (225 cells in total). One button, Update, applies the rules to all the cells on the grid (step). One paragraph area will show the status of different populations in the current step, for example, Susceptible: 35 Infected: 153 Recovered: 37 Step: 4. Finally, a button named Statistics writes a list with all the stats of each step [Susceptible, Infected, Recovered ....] into a text area for the ...

Get Practical Data Analysis - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.