r/Python • • Mar 11 '20

I Made This Really simple simulation of virus spreading. Black dots are people, yellow dots are infected (it starts from 1). Each cell visited by an infected can infect other people passing through that for 3 iterations. After 20 iterations a person is infected is deleted from the grid.

1.4k Upvotes

128 comments sorted by

View all comments

8

u/[deleted] Mar 12 '20

Sorry, I forgot to say that each person passing through a contaminated cell has a probability of 0.6 to get infected.

I wanted just to reply to those people who say this is scientifically nonsense:

  1. I made this just for fun it's not a PhD project or a publication

  2. It's a model! and a very easy one, I said that! Maybe you don't know but in science you build simplified models all the time... With that I don't want to say that this is a realistic one but just a model with the assumptions I said.. and you could get some meaningful results/ideas also from this easy model so it doesn't mean anything is scientifically nonsense...

1

u/mrasadnoman Mar 12 '20

What tools did you use for graphical simulation?

1

u/[deleted] Mar 12 '20

I just save in a text file the the position of each person and weather he's infected or not... then I read the data using gnuplot... you could reach the same (and I think it's easier) using matplotlib...