News spreading

This is a simulation based on TP8 “news propagation” of the “algorithmics and programmation” course at Univ. Grenoble-Alpes. The goal is to simulate how a news propagates in a population. Initially only one individual knows the news, the others are ignorant. At each step, only 2 random agents will meet, and their status regarding the news can evolve in different ways:
* an agent knowing the news will tell it to an agent ignoring it, who then also becomes “knowing”
* two agents both knowing the news will become mute upon meeting: they believe that everybody knows the news, so they won’t tell it anymore
* mute agents stay mute forever
* when no agents are “knowing” the news anymore, the simulation stops. Ignorant and mute agents say nothing so nobody will change status ever again.

This simulator creates a number of agents, organises random meetings, and plots the proportion of agents in each status over time. It also plots the number of useful meetings (some gains knowledge), muting meetings (someone stops telling the news), or useless meetings (nobody changes status) over time. A text console logs all meetings that happened.

LET’s SPREAD the NEWS