-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation_migration_default_params.py
50 lines (42 loc) · 1.45 KB
/
simulation_migration_default_params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Check Migration
Test migration
"""
__author__ = "Tonje Martine Lorgen Kirkholt", "Sougata Bhattacharya"
__email__ = "[email protected]", "[email protected]"
import textwrap
from biosim.simulation import BioSim
if __name__ == '__main__':
geogr = """\
WWWWWWWWWWWWWWWWWWWWW
WWWWWWWWHWWWWLLLLLLLW
WHHHHHLLLLWWLLLLLLLWW
WHHHHHHHHHWWLLLLLLWWW
WHHHHHLLLLLLLLLLLLWWW
WHHHHHLLLDDLLLHLLLWWW
WHHLLLLLDDDLLLHHHHWWW
WWHHHHLLLDDLLLHWWWWWW
WHHHLLLLLDDLLLLLLLWWW
WHHHHLLLLDDLLLLWWWWWW
WWHHHHLLLLLLLLWWWWWWW
WWWHHHHLLLLLLLWWWWWWW
WWWWWWWWWWWWWWWWWWWWW"""
geogr = textwrap.dedent(geogr)
ini_herbs = [{'loc': (3, 2),
'pop': [{'species': 'Herbivore',
'age': 5,
'weight': 20}
for _ in range(50)]}]
ini_carns = [{'loc': (3, 2),
'pop': [{'species': 'Carnivore',
'age': 5,
'weight': 20}
for _ in range(20)]}]
sim = BioSim(island_map=geogr,
ini_pop=ini_herbs,
seed=100,
vis_years=0,
console_output_island=True)
sim.simulate(10)
sim.add_population(ini_carns)
sim.simulate(50)