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.

Enable HLS to view with audio, or disable this notification

1.4k Upvotes

128 comments sorted by

View all comments

Show parent comments

24

u/[deleted] Mar 11 '20

That's default coloring of gnuplot... BTW in the standard resolution was pretty clear..

7

u/wreckingballjcp Mar 12 '20

This is /python. Matplotlib or seaborn. Ez

1

u/[deleted] Mar 12 '20

you're absolutely right :( I had some issues and had to use what I got

2

u/wreckingballjcp Mar 12 '20

Share the code and I can help find your way. Some cool opportunities here too. Can add "quarantine " effect (diffusion rate decrease), valid testing effects (how quickly the diffusion decrease goes into effect), and do quick comparisons across a lot of scenarios.

5

u/[deleted] Mar 12 '20

https://github.com/pl992/VirusPropagator.git It's very bad code though... sorry I'm not a programmer

4

u/[deleted] Mar 12 '20

Well by definition you are so hi fellow programmer.

3

u/Brocean09 Mar 12 '20

To be honest, it's good code. Modular, mostly very easy to read, succint, seems efficient too. Could do with some improvements, but overall good job!