==> Parameters

# ==> Scenarios

## Scenarios ==> CurrentScenario

Scenario codes (the values below are read automatically in 'Evolife.leo'):
==============
Void # a scenario that does nothing
Genetic algorithm
-----------------
SumBits # maximizes the number of 1 in the DNA
Labyrinth # tries to escape from a labyrinth
WernerDyer # emergence of a communication code
Zip # tries to make the DNA (un)compressible
Behavioural Ecology
-------------------
> Solitary games
Favourable # favourable mutation: basic Darwinian principle
GroupAltruist # group selection
Parthenogenesis # females beget clones of themselves
SexRatio # parents control the sex ratio among their children
> Dyadic games
Altruist # provides help at own's expense
KinAltruist # provides help towards kin
Cooperation # evolution of reciprocal cooperation
GreenBeard # provides help to other cariers of the same mutation
Signalling # individuals form coalitions
StagHunt # individuals play a 'stag hunt' game
Ethnocentrism
Bargaining
Coordination

### Scenarios ==> CurrentScenario ==> ScenarioName

### Scenarios ==> CurrentScenario ==> ScenarioFileName

## Scenarios ==> Genetic Algorithms

### Scenarios ==> Genetic Algorithms ==> SumBits

This example is meant as a didactic approach to genetic algorithms (and certainly not as a realistic application, as the problem is much too simple for a GA). The problem is to maximize the number of bits set to 1 in a binary vector. Starting from a random population, in which individuals have only roughly half of the bits equals to 1 in their genome, evolution through natural selection should rapidly produce 'perfect' individuals whose genome is uniformly made of 1s.

### Scenarios ==> Genetic Algorithms ==> Labyrinth

Scenario Labyrinth:
The individuals' DNA guides a 'robot' through a labyrinth,
with the hope of getting out of it

#### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation

" Evaluation reads: "
Evaluation = PenaltyWall * (MaxSteps - walls) \
+ PenaltyU_turn * (MaxSteps - u_turns)\
+ PenaltyPoison * (MaxPheromon * MaxSteps +1 - poison) \
+ RewardExit * (MaxSteps - step -1)

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> MaxSteps

Maximum number of steps

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> MaxSteps ==> 55

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyPoison

Penalty for encountering poisonous pheromon

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyPoison ==> 1

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> MaxPoison

Maximal quantity of pheromon a cell may hold

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> MaxPoison ==> 10

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyU_turn

Penalty for making a u-turn

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyU_turn ==> 0

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyWall

Penalty for bumping into a wall

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> PenaltyWall ==> 0

##### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> RewardExiting

Reward for saving steps when exiting

###### Scenarios ==> Genetic Algorithms ==> Labyrinth ==> Evaluation ==> RewardExiting ==> 20

### Scenarios ==> Genetic Algorithms ==> WernerDyer

EVOLIFE: Scenario WernerDyer :
see: http://www.telecom-paristech.fr/~icc/IC/projects/P06121815.html (in English)
see: http://www.dessalles.fr/outgoing/P05013107.html (in French, more detailed)
Relevant parameters are:
- Compass (if set to 1, individuals orient themselves along absolute directions, N,E,W,S)
- WDGridSize: size of the toric world in which individuals move
- PopulationSize: how crowdy the world is
- Selectivity: how many children are given to a successful couple
- Noise: defines in % how often a random direction is taken

#### Scenarios ==> Genetic Algorithms ==> WernerDyer ==> Compass

Indicates whether the female part of the DNA codes for absolute directions (East, North, West, South) (Compass==1)
or codes for direction change (straight on, left, right, u-turn) (Compass==0).

##### Scenarios ==> Genetic Algorithms ==> WernerDyer ==> Compass ==> 0

#### Scenarios ==> Genetic Algorithms ==> WernerDyer ==> WDGridSize

##### Scenarios ==> Genetic Algorithms ==> WernerDyer ==> WDGridSize ==> 100

### Scenarios ==> Genetic Algorithms ==> Zip

This scenario uses a genetic algorithm to simplify a string, or conversely make it more complex.
Here, complexity is assessed by the size of its compressed length (using compressor gzip or bzip2).
The point is to show that simplification produces quasi-periodic strings and that it is difficult
for standard genetic algorithms to escape from local optima.
When the 'Simplify' parameter is set to 0, the programme ideally attempts to
generate a random (i.e. incompressible) sequence.
In the not-BitString mode, the evolution gets more obviously trapped in many local optima.

#### Scenarios ==> Genetic Algorithms ==> Zip ==> BitString

If BitString is set to 0, the DNA is translated into a string of charaters '0' and '1'
Otherwise it is translated into a binary string

##### Scenarios ==> Genetic Algorithms ==> Zip ==> BitString ==> 0

#### Scenarios ==> Genetic Algorithms ==> Zip ==> bz2

If set to 0, uses gzip as compressor.
Otherwise, uses bzip2.

##### Scenarios ==> Genetic Algorithms ==> Zip ==> bz2 ==> 0

#### Scenarios ==> Genetic Algorithms ==> Zip ==> Simplify

If set to 0, tries to make genomes more complex.
Otherwise, tries to make genomes simpler.

##### Scenarios ==> Genetic Algorithms ==> Zip ==> Simplify ==> 1

## Scenarios ==> Behavioural Ecology

### Scenarios ==> Behavioural Ecology ==> Favourable

Simple Darwinian scenario: carriers of gene named 'Favourable' get life points.
The gene is expected to invade the population.
Alternatively, individuals get some collective benefit from the fact that
there are carriers of the 'Favourable' gene in the group. In that case,
the fate of the gene is no longer obvious, even if the collective benefit is high!

#### Scenarios ==> Behavioural Ecology ==> Favourable ==> IndividualBenefit

##### Scenarios ==> Behavioural Ecology ==> Favourable ==> IndividualBenefit ==> 2

#### Scenarios ==> Behavioural Ecology ==> Favourable ==> CollectiveBenefit

##### Scenarios ==> Behavioural Ecology ==> Favourable ==> CollectiveBenefit ==> 0

### Scenarios ==> Behavioural Ecology ==> GreenBeard

This small experiment was proposed in Richard Dawkins's book The selfish gene. It shows how some interesting coupling between genes may emerge in a population.
Suppose a given gene has two effects on its carriers: (1) they get a conspicuous characteristic, like a green beard; (2) they tend to behave altruistically toward green-bearded individuals. Such a gene is expected to invade the population, whereas its allele (no green beard + no altruism) tends to disappear.

#### Scenarios ==> Behavioural Ecology ==> GreenBeard ==> GB_Gift

##### Scenarios ==> Behavioural Ecology ==> GreenBeard ==> GB_Gift ==> 100

#### Scenarios ==> Behavioural Ecology ==> GreenBeard ==> GB_Cost

##### Scenarios ==> Behavioural Ecology ==> GreenBeard ==> GB_Cost ==> 10

### Scenarios ==> Behavioural Ecology ==> SexRatio

If the sex ratio in the progeny is genetically controlled, a 50-50 ratio
emerges, despite the fact that males consume resources without investing
in offspring.
However, in hymenoptera (wasps, bees, ants), in which males are haploid
(one exemplar for each chomosome) whereas females are diploid (two exemplars
of each chromosome), sex ratio is expected to converge toward 25-75 whenever
it is controlled by genes expressed in sisters (workers).

#### Scenarios ==> Behavioural Ecology ==> SexRatio ==> Hymenoptera

##### Scenarios ==> Behavioural Ecology ==> SexRatio ==> Hymenoptera ==> 0

### Scenarios ==> Behavioural Ecology ==> Beehive

This scenario does not exist yet !

## Scenarios ==> Dyadic games

### Scenarios ==> Dyadic games ==> Bargaining

### Scenarios ==> Dyadic games ==> Cooperation

Cooperation Scenario:
Individual A cooperates with individual B with the hope that
B will reciprocate. A remembers B if it is the case.

#### Scenarios ==> Dyadic games ==> Cooperation ==> FirstStep

Indicates the maximal number of score points
that can be granted by the first player to its partner.
This amount is modulated by the value of the first player's
corresponding gene.

##### Scenarios ==> Dyadic games ==> Cooperation ==> FirstStep ==> 55

#### Scenarios ==> Dyadic games ==> Cooperation ==> FirstStepCost

Proportional price, in percent, payed by the first player.

##### Scenarios ==> Dyadic games ==> Cooperation ==> FirstStepCost ==> 30

#### Scenarios ==> Dyadic games ==> Cooperation ==> SecondStep

##### Scenarios ==> Dyadic games ==> Cooperation ==> SecondStep ==> 55

#### Scenarios ==> Dyadic games ==> Cooperation ==> SecondStepCost

##### Scenarios ==> Dyadic games ==> Cooperation ==> SecondStepCost ==> 30

#### Scenarios ==> Dyadic games ==> Cooperation ==> MinReward

Below this return value (in % of 'FirstStep'),
the first player decides to quit
its preferred partner

##### Scenarios ==> Dyadic games ==> Cooperation ==> MinReward ==> 0

### Scenarios ==> Dyadic games ==> Coordination

#### Scenarios ==> Dyadic games ==> Coordination ==> Nb_signaux

##### Scenarios ==> Dyadic games ==> Coordination ==> Nb_signaux ==> 8

### Scenarios ==> Dyadic games ==> CostlySignal

EVOLIFE: Costly Signal Scenario:
Individuals may emit a signal in relation with their quality.
Emitting this signal involves a cost.
Receivers read the signal and decide to associate or not with the emitter.
Association provides benefit to emitters.
Association provides benefit to receivers only if emitter is of high quality.
Evolution leads to a situation in which communication is honest,
i.e. individuals signal their true quality.
This is due to the fact that liars (l-q signalling individuals) cannot
afford the cost of high signals.

#### Scenarios ==> Dyadic games ==> CostlySignal ==> BottomQuality

Minimal quality that adds to the signalled quality

##### Scenarios ==> Dyadic games ==> CostlySignal ==> BottomQuality ==> 50

#### Scenarios ==> Dyadic games ==> CostlySignal ==> CostlySignalCost

##### Scenarios ==> Dyadic games ==> CostlySignal ==> CostlySignalCost ==> 50

#### Scenarios ==> Dyadic games ==> CostlySignal ==> FollowerBenefit

##### Scenarios ==> Dyadic games ==> CostlySignal ==> FollowerBenefit ==> 100

#### Scenarios ==> Dyadic games ==> CostlySignal ==> FollowerSupport

##### Scenarios ==> Dyadic games ==> CostlySignal ==> FollowerSupport ==> 40

### Scenarios ==> Dyadic games ==> Ethnocentrism

### Scenarios ==> Dyadic games ==> GreenBeard

### Scenarios ==> Dyadic games ==> Signalling

Signalling Scenario:
Individual A signals its competence
Other individuals may choose to join A based on that competence.
A benefits from their joining (e.g. protection)
correlated with their competence
(think of it as an ability to anticipate danger)
Signalling is thus a way of attracting competent individuals

#### Scenarios ==> Dyadic games ==> Signalling ==> BottomCompetence

Minimal competence that adds to the signalled competence
Typical value: 50

##### Scenarios ==> Dyadic games ==> Signalling ==> BottomCompetence ==> 5

#### Scenarios ==> Dyadic games ==> Signalling ==> CompetenceImpact

Maximal reduction of risk that an individual A gives to another B (in %).
B's risk probability is multiplied by (1 - CompetenceImpact * RankEffect ** R * A's_competence / G)
where R is B's rank in A's address book, and G is a function of the number of A's friends.
Typical value: 100

##### Scenarios ==> Dyadic games ==> Signalling ==> CompetenceImpact ==> 200

#### Scenarios ==> Dyadic games ==> Signalling ==> CompetenceSignificance

Significance of recruting competent individuals as friends,
as compared to other qualities like physical strength, in %
(0% means that competence is not taken into account when making friends,
100% means that only competence is taken into account).
Typical value: 100

##### Scenarios ==> Dyadic games ==> Signalling ==> CompetenceSignificance ==> 100

#### Scenarios ==> Dyadic games ==> Signalling ==> RankEffect

Multiplicative decrease (in %) of friendly support.
If the signaller has rank R in its friend's list of contacts, the signaller gets
Friend's Competence * (RankEffect/100) ** R
Typical value: 60

##### Scenarios ==> Dyadic games ==> Signalling ==> RankEffect ==> 80

#### Scenarios ==> Dyadic games ==> Signalling ==> SignallingCost

Cost of producing signals.
Signals may indirectly reveal the signaller's competence.
This is only true if individuals invest in signalling.
Signalling investments are genetically controlled.
Typical value: 20

##### Scenarios ==> Dyadic games ==> Signalling ==> SignallingCost ==> 100

#### Scenarios ==> Dyadic games ==> Signalling ==> SocialOverlap

Controls the facts that available social time may be spent with several friends simultaneously.
(between 0: no overlap, and 100: maximal natural overlap).
When no overlap, introducing a new friend diminish old friends' share significantly.
Typical value: 30

##### Scenarios ==> Dyadic games ==> Signalling ==> SocialOverlap ==> 80

### Scenarios ==> Dyadic games ==> StagHunt

Stag Hunt Scenario (after Brian Skyrms, "The stag hunt",
Cambridge University Press 2004, pp. 67-70)
In the stag hunt scenario, two players have the choice:
- either to cooperate to hunt a stag (S)
- or to defect and hunt a hare (H) for themselves.
The payoff matrix is as follows:
opponent
S H
S 9 1
player
H 8 7
This is a particular case of stag hunt in which it is better to
hunt hare against a stag hunter rather than against a hare hunter.
Such game is also called "assurance game".
In the absence of any signalling, there are two equilibria:
everyone hunts stag or everyone hunts hare.
If individuals are given the possibility of sending a binary signal before
acting, then the new situation creates one equilibrium in which
half of the population sends signal 0 and hunts stag with those having sent
1 and hunts hare otherwise, and conversely for the other half.

#### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix

##### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> StagStag

###### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> StagStag ==> 9

##### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> StagHare

###### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> StagHare ==> 0

##### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> HareStag

###### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> HareStag ==> 8

##### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> HareHare

###### Scenarios ==> Dyadic games ==> StagHunt ==> PayoffMatrix ==> HareHare ==> 7

# ==> Ecology

## Ecology ==> PopulationSize

The size of the population is maintained constant

### Ecology ==> PopulationSize ==> 100

## Ecology ==> MigrationRate

Each year, a fraction (in %) of individuals migrate between groups.

### Ecology ==> MigrationRate ==> 10

## Ecology ==> ReproductionRate

Proportion of the population that is replaced with newborns each year (in %)

### Ecology ==> ReproductionRate ==> 30

## Ecology ==> SelectionPressure

Defines how individual survival depends on score:
0 --> no bias
12 --> Highest scores may have 12 times less chance to be eliminated
than individuals with lowest scores
(Note that selection is also achieved through differential reproduction
(see parameter Selectivity))
Important: For selection pressure to operate properly, scores should always be positive
Warning: This selection method tends to "saturate": when most scores reach high values,
the method is blind to slight differences among individuals. However, it might be less
violent than the selectivity method, which has converse qualities.

### Ecology ==> SelectionPressure ==> 0

## Ecology ==> Selectivity

Defines how parenthood is biased toward individuals with high scores
S == 0 --> no bias
S == 1 --> elitism is roughly linear
S == 20 --> strong elitism
S == 40 --> very strong elitism
(Note that selection is also achieved through differential mortality
(see parameter SelectionPressure))
Warning: This selection method amplifies small differences among top inidividuals,
but fails to discriminate among the crowd. The SelectionPressure method has converse
qualities.

### Ecology ==> Selectivity ==> 40

## Ecology ==> GroupMaxSize

The population is split in groups.
Groups are an ecological entity: reproductions and interactions take place within the group.
"Group maximal size" indicates the maximal size of a group. Groups that are too big are split in two.
Expect actual groups to be roughly half of that size.

### Ecology ==> GroupMaxSize ==> 500

## Ecology ==> GroupMinSize

Group minimal size
Groups that are too small are dissolved: their members must emigrate to other existing groups

### Ecology ==> GroupMinSize ==> 0

## Ecology ==> Rounds

Numbers of times each individual interacts with others each year

### Ecology ==> Rounds ==> 0

## Ecology ==> AgeMax

Above that age, individuals die. Set to 0 if no maximum age.

### Ecology ==> AgeMax ==> 40

## Ecology ==> Noise

Amplitude of a multiplicative noise
in % between 0 and 100
that may affect interactions in some
scenarios.

### Ecology ==> Noise ==> 10

# ==> Sociology

## Sociology ==> SocialSymmetry

This flag indicates whether the amount of time devoted to a social relation is
equal between the two parties. If set to 0, fans may loose time in the anteroom
of their idol.

### Sociology ==> SocialSymmetry ==> 1

## Sociology ==> MaxGurus

Maximum number of output links from a node in the affiliation graph.
Typically between 1 and a few.

### Sociology ==> MaxGurus ==> 1

## Sociology ==> MaxFollowers

Maximum number of input links to a node in the affiliation graph.
Typically between 1 and many.
This may be a crucial parameter: if it is significantly larger
than 'MaxGurus', then a star system may evolve in which only
best individuals signal.

### Sociology ==> MaxFollowers ==> 3

# ==> Genetics

## Genetics ==> MutationRate

Mutation rate in xxx/1000

### Genetics ==> MutationRate ==> 10

## Genetics ==> NbCrossover

Indicates the number of cut points when performing crossover

### Genetics ==> NbCrossover ==> 1

## Genetics ==> GeneCoding

Indicates the way portions of DNA should ne interpreted
0 = WEIGHTED: standard integer binary coding
1 = UNWEIGHTED: all bits play symmertrical roles
-1 = NOCODING: genome is not decoded
Note: the WEIGHTED method may provoke sudden changes in
gene expression. This may be good to escape from local
optima, since in the UNWEIGHTED condition, several
mutations must be accumulated in the same individuals
for significant change to occur.

### Genetics ==> GeneCoding ==> 1

### Genetics ==> GeneCoding ==> 0: Weighted

Genes interpreted as standard integer coding.
Advantage: many available values;
variable selection pressure on loci:
important loci evolve first.
Mutations on low bits have local effects
Caveat: getting from 011111 to 100000 requires
six mutations, though the values are adjacent.

#### Genetics ==> GeneCoding ==> 0: Weighted ==> Weighted

##### Genetics ==> GeneCoding ==> 0: Weighted ==> Weighted ==> 0

### Genetics ==> GeneCoding ==> 1: Unweighted

Genes interpreted as the sum of their bits
Advantage: all puncutal mutation have local effects
Caveat: only few values allowed if gene length is small,
and very slow evolution and high sensitivity to noise
if gene length is large

#### Genetics ==> GeneCoding ==> 1: Unweighted ==> Unweighted

##### Genetics ==> GeneCoding ==> 1: Unweighted ==> Unweighted ==> 1

### Genetics ==> GeneCoding ==> 2: Gray

Genes are interpreted using a Gray code.
In a Gray code, neighbouring integers differ by only one bit.
Advantage: neighbouring values are reachable by punctual mutations
Caveat: most punctual mutations have non-local effects

#### Genetics ==> GeneCoding ==> 2: Gray ==> Gray

##### Genetics ==> GeneCoding ==> 2: Gray ==> Gray ==> 2

### Genetics ==> GeneCoding ==> -1: NoCoding

#### Genetics ==> GeneCoding ==> -1: NoCoding ==> NoCoding

##### Genetics ==> GeneCoding ==> -1: NoCoding ==> NoCoding ==> -1

## Genetics ==> GeneLength

Some scenarios don't specify gene length (by setting it to zero).
The value indicated here is taken as default value in this case.

### Genetics ==> GeneLength ==> 100

## Genetics ==> DNAFill

DNA created from scratch may be random (DNAFill = -1)
or filled withl 0s (DNAFill = 0) or with 1s (DNAFill =1)

### Genetics ==> DNAFill ==> -1

## Genetics ==> StartFromFile

Binary flag indicating if the population should be generated from
the genomes stored in the text file 'EvoStart.gen'
1 = reads 'EvoStart.gen'
0 = creates a new population from scratch (see parameter DNAFill)

### Genetics ==> StartFromFile ==> 0

## Genetics ==> ControlGeneNumber

Functions of one parameter are difficult to code genetically.
The easiest way is to code for a step function.
Example: code for a "signal" that depends on a parameter called "competence".
When emitting the signal, an individual "reads" her competence and
depending on its range, mutliplies it by the relative value of
her corresponding control gene.
0 competence Max
[--------------------------------------------------]
<-----------><-----------><-----------><----------->
CG1 CG2 CG3 CG4
Typical value: 6

### Genetics ==> ControlGeneNumber ==> 6

# ==> Display

## Display ==> BatchMode

If set to 1, no display occurs. Useful to launch experiments in batch mode, e.g. on several machines.
Results are still stored in .csv files. In batch mode, these files are given unique names, so that
different experiments can be run simultaneously.

### Display ==> BatchMode ==> 0

## Display ==> DisplayPeriod

Period between successive plots
0: no plot
1: plot every year
10: typical

### Display ==> DisplayPeriod ==> 1

## Display ==> TimeLimit

Maximum number of steps before simulation stops. Set to 0 if no limit.
If DisplayPeriod == 0, Evolife will automatically exit after TimeLimit.
Otherwise, it will switch to stepwise mode. It is thus ready to
run until another TimeLimit is reached again.

### Display ==> TimeLimit ==> 20000

## Display ==> DumpStart

Points located below this x-value are discarded from the computation of average values.
Average values thus reflect the stable regime.

### Display ==> DumpStart ==> 100

# ==> Run

## Run ==> EvolifeDir

Path to Evolife

### Run ==> EvolifeDir ==> x:/recherch/evopy/Evolife

##

##