Mercurial > repos > siwaa > gama
annotate src/MY_predatorPrey.gaml @ 0:f895e266b37a draft
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
author | siwaa |
---|---|
date | Tue, 04 Jun 2024 15:18:01 +0000 |
parents | |
children |
rev | line source |
---|---|
0
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
1 /** |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
2 * Name: Breeding of prey and predator agents |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
3 * Author: |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
4 * Description: 6th part of the tutorial : Predator Prey |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
5 * Tags: reproduce, myself, self |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
6 */ |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
7 model prey_predator |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
8 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
9 global { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
10 int nb_preys_init <- 200; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
11 int nb_predators_init <- 20; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
12 float prey_max_energy <- 1.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
13 float prey_max_transfer <- 0.1; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
14 float prey_energy_consum <- 0.05; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
15 float predator_max_energy <- 1.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
16 float predator_energy_transfer <- 0.5; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
17 float predator_energy_consum <- 0.02; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
18 float prey_proba_reproduce <- 0.01; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
19 int prey_nb_max_offsprings <- 5; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
20 float prey_energy_reproduce <- 0.5; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
21 float predator_proba_reproduce <- 0.01; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
22 int predator_nb_max_offsprings <- 3; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
23 float predator_energy_reproduce <- 0.5; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
24 int nb_preys -> {length(prey)}; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
25 int nb_predators -> {length(predator)}; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
26 bool is_batch <- false; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
27 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
28 init { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
29 create prey number: nb_preys_init; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
30 create predator number: nb_predators_init; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
31 write(self); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
32 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
33 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
34 reflex stop_simulation when: ((nb_preys = 0) or (nb_predators = 0)) and !is_batch { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
35 do pause; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
36 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
37 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
38 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
39 species generic_species { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
40 float size <- 1.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
41 rgb color; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
42 float max_energy; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
43 float max_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
44 float energy_consum; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
45 float proba_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
46 int nb_max_offsprings; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
47 float energy_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
48 vegetation_cell my_cell <- one_of(vegetation_cell); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
49 float energy <- rnd(max_energy) update: energy - energy_consum max: max_energy; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
50 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
51 init { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
52 location <- my_cell.location; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
53 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
54 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
55 reflex basic_move { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
56 my_cell <- one_of(my_cell.neighbors2); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
57 location <- my_cell.location; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
58 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
59 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
60 reflex eat { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
61 energy <- energy + energy_from_eat(); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
62 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
63 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
64 reflex die when: energy <= 0 { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
65 do die; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
66 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
67 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
68 reflex reproduce when: (energy >= energy_reproduce) and (flip(proba_reproduce)) { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
69 int nb_offsprings <- rnd(1, nb_max_offsprings); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
70 create species(self) number: nb_offsprings { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
71 my_cell <- myself.my_cell; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
72 location <- my_cell.location; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
73 energy <- myself.energy / nb_offsprings; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
74 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
75 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
76 energy <- energy / nb_offsprings; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
77 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
78 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
79 float energy_from_eat { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
80 return 0.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
81 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
82 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
83 aspect base { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
84 draw circle(size) color: color; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
85 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
86 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
87 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
88 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
89 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
90 reflex save_result when: (nb_preys > 0) and (nb_predators > 0){ |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
91 save ("cycle: "+ cycle + "; nbPreys: " + nb_preys |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
92 + "; minEnergyPreys: " + (prey min_of each.energy) |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
93 + "; maxSizePreys: " + (prey max_of each.energy) |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
94 + "; nbPredators: " + nb_predators |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
95 + "; minEnergyPredators: " + (predator min_of each.energy) |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
96 + "; maxSizePredators: " + (predator max_of each.energy)) |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
97 to: "results.txt" type: "text" rewrite: (cycle = 0) ? true : false; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
98 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
99 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
100 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
101 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
102 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
103 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
104 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
105 species prey parent: generic_species { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
106 rgb color <- #blue; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
107 float max_energy <- prey_max_energy; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
108 float max_transfer <- prey_max_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
109 float energy_consum <- prey_energy_consum; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
110 float proba_reproduce <- prey_proba_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
111 int nb_max_offsprings <- prey_nb_max_offsprings; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
112 float energy_reproduce <- prey_energy_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
113 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
114 float energy_from_eat { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
115 float energy_transfer <- 0.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
116 if(my_cell.food > 0) { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
117 energy_transfer <- min([max_transfer, my_cell.food]); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
118 my_cell.food <- my_cell.food - energy_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
119 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
120 return energy_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
121 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
122 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
123 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
124 species predator parent: generic_species { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
125 rgb color <- #red; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
126 float max_energy <- predator_max_energy; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
127 float energy_transfer <- predator_energy_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
128 float energy_consum <- predator_energy_consum; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
129 float proba_reproduce <- predator_proba_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
130 int nb_max_offsprings <- predator_nb_max_offsprings; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
131 float energy_reproduce <- predator_energy_reproduce; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
132 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
133 float energy_from_eat { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
134 list<prey> reachable_preys <- prey inside (my_cell); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
135 if(! empty(reachable_preys)) { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
136 ask one_of (reachable_preys) { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
137 do die; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
138 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
139 return energy_transfer; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
140 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
141 return 0.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
142 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
143 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
144 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
145 grid vegetation_cell width: 50 height: 50 neighbors: 4 { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
146 float max_food <- 1.0; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
147 float food_prod <- rnd(0.01); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
148 float food <- rnd(1.0) max: max_food update: food + food_prod; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
149 rgb color <- rgb(int(255 * (1 - food)), 255, int(255 * (1 - food))) update: rgb(int(255 * (1 - food)), 255, int(255 * (1 - food))); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
150 list<vegetation_cell> neighbors2 <- (self neighbors_at 2); |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
151 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
152 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
153 experiment prey_predator type: gui { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
154 parameter "Initial number of preys: " var: nb_preys_init min: 0 max: 1000 category: "Prey"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
155 parameter "Prey max energy: " var: prey_max_energy category: "Prey"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
156 parameter "Prey max transfer: " var: prey_max_transfer category: "Prey"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
157 parameter "Prey energy consumption: " var: prey_energy_consum category: "Prey"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
158 parameter "Initial number of predators: " var: nb_predators_init min: 0 max: 200 category: "Predator"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
159 parameter "Predator max energy: " var: predator_max_energy category: "Predator"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
160 parameter "Predator energy transfer: " var: predator_energy_transfer category: "Predator"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
161 parameter "Predator energy consumption: " var: predator_energy_consum category: "Predator"; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
162 parameter 'Prey probability reproduce: ' var: prey_proba_reproduce category: 'Prey'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
163 parameter 'Prey nb max offsprings: ' var: prey_nb_max_offsprings category: 'Prey'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
164 parameter 'Prey energy reproduce: ' var: prey_energy_reproduce category: 'Prey'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
165 parameter 'Predator probability reproduce: ' var: predator_proba_reproduce category: 'Predator'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
166 parameter 'Predator nb max offsprings: ' var: predator_nb_max_offsprings category: 'Predator'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
167 parameter 'Predator energy reproduce: ' var: predator_energy_reproduce category: 'Predator'; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
168 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
169 output { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
170 display main_display { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
171 grid vegetation_cell border: #black; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
172 species prey aspect: base; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
173 species predator aspect: base; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
174 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
175 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
176 monitor "Number of preys" value: nb_preys; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
177 monitor "Number of predators" value: nb_predators; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
178 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
179 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
180 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
181 experiment Optimization type: batch repeat: 2 keep_seed: true until: ( time > 200 ) { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
182 parameter "Predator energy reproduce:" var: predator_energy_reproduce min: 0.25 max: 1.0 step: 0.25; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
183 parameter "Batch mode:" var: is_batch <- true; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
184 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
185 method tabu maximize: nb_preys + nb_predators iter_max: 10 tabu_list_size: 3; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
186 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
187 |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
188 reflex save_results_explo { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
189 ask simulations { |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
190 save [int(self),prey_max_transfer,prey_energy_reproduce,predator_energy_transfer,predator_energy_reproduce,self.nb_predators,self.nb_preys] |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
191 to: "results.csv" format:csv rewrite: (int(self) = 0) ? true : false header: true; |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
192 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
193 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
194 } |
f895e266b37a
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
siwaa
parents:
diff
changeset
|
195 |