-
Notifications
You must be signed in to change notification settings - Fork 1
Model
The model description is split into two parts. The first part, Data, specifies which data AEGIS is manipulating and how the data is structured. The second part, Algorithm, explains how the data is being manipulated during the simulation.
Core data in AEGIS can be captured by three variables — ages
MAX_LIFESPAN
).
where
for
$$\begin{bmatrix} A_1 & A_2 & ... & A_L \end{bmatrix}$$
where
$$\begin{bmatrix} D_1^{c} & D_2^c & ... & D_L^c \end{bmatrix}$$
where
$$\begin{bmatrix} \frac{1}{n} \Sigma_i^n g_{i,1} & \frac{1}{n} \Sigma_i^n g_{i,2} & ... & \frac{1}{n} \Sigma_i^n g_{i,B} \end{bmatrix}$$
where
$$\begin{bmatrix} med_i (p_{i,1}^s) & ... & ... & med_i (p_{i,L}^s), & med_i (p_{i,1}^r) & ... & ... & med_i (p_{i,L}^r) \end{bmatrix}$$
where
The simulation is not continuous but discrete; i.e. it runs in stages. The number of stages is defined by the parameter STAGES_PER_SIMULATION_
. During every stage, a few steps are performed (relevant code in Ecosystem.run_stage
). These are described below.
If the population size MAX_POPULATION_SIZE
, individuals incur a survival penalty – i.e. some individuals will die. The number and the selection of individuals to kill depends on the parameter OVERSHOOT_EVENT
. The default setting of that parameter is starvation in which the number of dying individuals increases with time (as long as the population size exceeds the specified threshold) and the selection of individuals is random (young are equally susceptible to it as old). However, other settings are available in which selection can be biased toward young or old and in which the number of dying individuals is more or less.
Each individual
Each individual REPRODUCTION_MODE
.
If the reproduction is asexual, the offspring genomes are constructed by taking copies of the parental genomes and then introducing random mutations.
If the reproduction is sexual, the construction of offspring genomes is more complex (relevant code in Reproducer.__call__
) as it also entails recombination and random pairing. First, every reproducing individual emits two germ cells into the genetic pool. Each germ cell is generated by copying the genome, recombining it (at the rate set by RECOMBINATION_RATE
) and then splitting it making it haploid while discarding the other half. Next, germ cells randomly fuse to create diploid genomes. No self-fertilization is allowed to occur, so if only one individual can reproduce, no actual reproduction occurs. After pairing, random mutations are introduced into the constructed genomes.
In both sexual and asexual reproduction, every bit has some probability of mutating after the genomes are generated. MUTATION_RATIO
, and their sum probability G_muta_initial
.
Each individual
After the whole stage is executed, collected data is saved as is described here.