python_corona_simulation icon indicating copy to clipboard operation
python_corona_simulation copied to clipboard

Can't get it towork

Open Logic-gate opened this issue 5 years ago • 1 comments

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,

Logic-gate avatar Apr 26 '20 00:04 Logic-gate

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

paulvangentcom avatar Apr 28 '20 08:04 paulvangentcom