O'Reilly logo

Practical Data Analysis by Hector Cuesta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 grid of 15 x 15 cells (225 total cells). An Update button that applies the rules to all the cells on the grid (step). A paragraph area that will show the status of different populations in the current step, for example, Susceptible: 35 Infected: 153 Recovered: 37 Step: 4. Finally, a Statistics button that writes a list with all the statistics of each step (susceptible, infected, recovered, and so on) into a text ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required