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

1

u/[deleted] Mar 12 '20

Why can't I use this on Pycharm?

1

u/[deleted] Mar 12 '20

what is the problem?

1

u/[deleted] Mar 12 '20

Well I don't know if im doing it wrong, but I copy and pasted the code into it. Hit run, saw it needed Numpy, downloaded Numpy. And now all it does is prints a number then ends

1

u/[deleted] Mar 12 '20

yep in that folder where you run it there will be many different files called world#### each of this file contains the position of each person... you can plot them using pyplot.scatter(c1,c2,c=c3) where c1,c2,c3 represent column 1,2,3 respectively. You should loop through all this files and create different pngs for each one if you want a the video

1

u/[deleted] Mar 12 '20

I don't understand any of that but its my new project to figure it out xD

1

u/[deleted] Mar 13 '20

If you're interested I've just added a function which makes a movie similar to the one shown here