paulvangentcom / python_corona_simulation Goto Github PK
View Code? Open in Web Editor NEWAn agent-based simulation of corona and other viruses in python
License: GNU General Public License v3.0
An agent-based simulation of corona and other viruses in python
License: GNU General Public License v3.0
Paul,
Wonderful job.
But I can't get the example to work.
The initial issue I got was with gridspec in the demo file, a few tweaks and importing matplotlib.gridspec resolved it.
The second issue was with initialize_population
in population.py
, it kept complaining about Config.pop_size
, again importing config in demo and passing Config as the first param seemed to resolve the issue.
Now it's complaining about destinations in infection.py.
if len(destinations) == 0: TypeError: object of type 'int' has no len()
After a bit of scooby dooing, I think I found a discrepancy between the infect function in demo and what it should be taking.
demo_COVID.py -- disregard the position of frame
and the introduction of c
population = infect(population, c, frame, infection_range, infection_chance, healthcare_capacity, verbose)
infection.py
def infect(population, Config, frame, send_to_location=False, location_bounds=[], destinations=[], location_no=1, location_odds=1.0):
Am I right to assume that this discrepancy is the main cause of the issue?
Now obviously I am doing something extremely wrong here, I would very much appreciate any feedback.
Cheers,
Hello,
I'm still facing bugs.
After solving the Config issue with the pop_size (still exist in the code) I crashed on the if len(destinations) == 0 at infection.py which fail. and than when passing population and destinations the program failed on tuple indices.
The simulation code is important for me and I think you have done a very good work.
I'm suggesting that the code will be deployed on clean environment and probably you will be able to solve everything in less than an hour.
Thanks and best Regards,
Elad
When running simulation.py:
Traceback (most recent call last):
File "simulation.py", line 11, in
from population import initialize_population, initialize_destination_matrix,
ImportError: cannot import name 'population_trackers' from 'population' (/Users/ismirkamili/pyprojects/python_corona_simulation/population.py)
When running simple_simulation.py
...
File "/Users/ismirkamili/pyprojects/python_corona_simulation/env/lib/python3.7/site-packages/matplotlib/cbook/init.py", line 418, in open_file_cm
fh, opened = to_filehandle(path_or_file, mode, True, encoding)
File "/Users/ismirkamili/pyprojects/python_corona_simulation/env/lib/python3.7/site-packages/matplotlib/cbook/init.py", line 403, in to_filehandle
fh = open(fname, flag, encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'render/0.png'
Any missing resource or module? I use python 3.7 with venv
Thank you
Feature request: Simple installation guide for the inexperienced / students. It would be of great help to educators.
Hi
I think your project is very well developed, so I am curious about what kind of Software Development Lifecycle Model you have adopted. The code my friend and I created was very messy, which made it very difficult for us to check each other's code
Hi, I tried to figure out have you coded the possibility to get infection again. This model seems to rely that once you get infected and recovered, you wont get infected any more. I found self.reinfect
I want to change the population but I don't know how
When I ran the Simulation.py, everything works fine except for the Axis 1 animation; only the colors change, but the person is not moving.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.