paulvangentcom / python_corona_simulation

An agent-based simulation of corona and other viruses in python
GNU General Public License v3.0
292 stars 76 forks source link

Can't get it towork #5

Open Logic-gate opened 4 years ago

Logic-gate commented 4 years ago

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,

paulvangentcom commented 4 years ago

this is correct, it seems I didn't include the COVID demo file in the refactor. I will work on this.