Esempio n. 1
0
            },
            "weight": {
                "max": 60,
                "delta": 2
            },
        },
    )

    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.0
    })
    sim.set_landscape_parameters("L", {"f_max": 700})

    sim.simulate(num_years=10, vis_years=1, img_years=2000)
    sim.save_simulation('sim')

    sim.add_population(population=ini_carns)
    sim.simulate(num_years=10, vis_years=1, img_years=2000)

    plt.savefig("check_sim.pdf")

    input("Press ENTER")

    island = sim.load_simulation('sim')
    sim.island = island
    sim.simulate(num_years=10, vis_years=1, img_years=2000)
Esempio n. 2
0
np.random.seed(1)

ini_herbs = [{
    'loc': (5, 5),
    'pop': [{
        'species': 'Herbivore',
        'age': 5,
        'weight': 50
    } for _ in range(50)]
}]

kart = """\
            WWWWWWWWWW
            WDDDDDDDDW
            WDDDDDDDDW
            WDDDHHDDDW
            WDDDLLDDDW
            WDDDHHDDDW
            WDDDLWDDDW
            WDDDWWHDDW
            WDDDDDDDDW
            WWWWWWWWWW"""

sim1 = BioSim(seed=123, ini_pop=ini_herbs, island_map=kart)
sim1.simulate(num_years=5)
sim1.save_simulation('state')

# Initiates BioSim with a state from a previous simulation
sim2 = BioSim(seed=123, ini_pop=[], save_name='state')
sim2.simulate(num_years=10)