sim.set_animal_parameters('Herbivore', {'zeta': 3.2, 'xi': 1.8}) sim.set_animal_parameters('Carnivore', {'a_half': 70, 'phi_age': 0.5, 'omega': 0.3, 'F': 65, 'DeltaPhiMax': 9.}) sim.set_landscape_parameters('L', {'f_max': 700}) sim.simulate(num_years=100, vis_years=1, img_years=2000) new_map = """\ WWWWWWWWWWWWWWWWWWWWW WWWWWWWWHWWWWLLLLLLLW WWHHHHLLLLWWLLLLLLLWW WWWHHHHHHHWWLLLLLLWWW WHWWHHLLLLLLLLLLLLWWW WHHWWHLLLDDLLLHLLLWWW WHHLWWLLDDDLLLHHHHWWW WWHHHWWWWWWWLLHWWWWWW WHHHLLLLLDDWWWLLLLWWW WHHHHLLLLDDLLWWWWWWWW WWHHHHLLLLLLLLWWWWWWW WWWHHHHLLLLLLLWWWWWWW WWWWWWWWWWWWWWWWWWWWW""" new_map = textwrap.dedent(new_map) sim.re_map(new_map) sim.add_population(population=ini_carns) sim.add_population(population=ini_snake) sim.simulate(num_years=100, vis_years=1, img_years=2000)
from biosim.simulation import BioSim ini_pop = [ { "loc":(2,2), "pop": [ { "species": "Herbivore", "age": 5, "weight": 100 } for _ in range(10) ] } ] sim = BioSim(island_map="WWWW\nWLHW\nWLHW\nWWWW",ini_pop=ini_pop) sim.simulate(50) sim.re_map(new_map="WWWW\nWHLW\nWWWW\nWWWW") sim.simulate(50) sim.re_map(new_map="WWWW\nWLHW\nWLHW\nWWWW") sim.simulate(50)