Telecom Paris
Dep. Informatique & Réseaux

J-L. DessallesHome page

November 2020


    Emergence in Complex Systems
     From nature to engineering

                                other AI courses


Please answer in English!

Emergence of sociality

Emergence of segregationism

Thomas Schelling (1971) studied the dynamics of residential segregation to elucidate the conditions under which individual decisions about where to live will interact to produce neighbourhoods that are segregated by race. His model shows that this can occur even though individuals do not act in a coordinated fashion to bring about these segregated outcomes.

Schelling proposed a prototype model in which individual agents are of two types, say red and blue, and are placed randomly on the squares of a checkerboard. The neighbourhood of an agent is defined to be the eight squares adjoining his location. Each agent has preferences over the composition of his neighbourhood, defined as the proportion of reds and blues. In each period, the most dissatisfied agent moves to an empty square provided a square is available that he prefers to his current location. The process continues until no one wants to move.

The typical outcome is a highly segregated state, although nobody actually prefers segregation to integration. You may have a look at this very beautiful visualisation of the phenomenon.

The program (in the directory Other/Segregationism ) implements agents of two types (red and blue) that move randomly. To run it, execute the local command starter and load the configuration file Segregationism.evo. The Configuration Editor allows you to change parameter values.

Schelling decision
Modify the method satisfaction called by decisionToMove in class Individual: agents inspect their neighbourhood (through the method InspectNeighbourhood), and decide whether to move away or not. Caveat: Python’s division may be understood as integer division when the operands are integers. Copy your modification in the box below.


Agents have only weak segregationist local behaviour, in the following sense: each agent wants at most 50% neighbours that differ from her/him; otherwise agents are indifferent. Implement the model and observe how segregation emerges. You may increase the value of DisplayPeriod in the Configuration Editor to speed up the simulation.

Schelling Tolerance (1)
Be sure to have loaded the configuration file Segregationism.evo.
With the first solution to the previous exercise, for wich minimal value of Tolerance does segregation disappear?


Schelling Tolerance (2)
Set Tolerance to 80. What happens and why?


Schelling Radius (1)
Be sure to reload the configuration file Segregationism.evo to bring parameters back to standard values.
Set neighbourhood radius from 1 to 4. Explain what we get with this larger value.


Schelling Radius (2)
Set neighbourhood radius to 10. Explain what we get.


Schelling Colours
Restore default parameters and try 3 colours. Describe what happens.


Suggestions for further work

Social bubbles

Social bubbles, also called filter bubbles, characterize a state of intellectual (or political or artistic...) isolation resulting from information bias. The phenomenon is to be observe when individual get information from their friends and tend to make friends among people who share the same kind of information. Recommender systems may amplify the phenomenon, as the content they suggest to you corresponds to what is selected by individuals who, in the past, have made choices similar to yours.

The simulation proposed here to illustrate the phenomenon is the most basic one may think of.

As a result, individuals tend to group into social bubbles corresponding to definite cinematographic preferences.

The program (in the directory Other/Segregationism ) implements this scenario. To run it, execute the local command starter and load the configuration file Bubbles.evo. The Configuration Editor allows you to change parameter values.

Two parameters are crucial here:

Try to find values for InfluenceRadius and NeighbourhoodRadius for which the social bubble phenomenon emerges.
Social bubbles
What is your value for NeighbourhoodRadius:    


Social bubbles
What is your value for InfluenceRadius:    


The hawk-dove dilemma

The existence of society supposes that violence remains contained. Can it be so in the absence of policing? Obviously, aggressive behaviour (intimidation) provides immediate payoff when performed against a non-aggressive victim. However, aggressors may loose a lot when confronting each other.
In Maynard Smith‘s hawk-dove game, possible interactions are hawk-hawk, dove-dove and dove-hawk. The matrix below gives the payoffs for strategies indicated in the first column:

Hawk-dove game




(V - C)/2





Two players confront each other over a resource whose full value is V to either of them. Each player may play one of two strategies: H (Hawk) or D (Dove). Doves signal that they wish to share the resource equally. Hawks signal they are willing to fight to get the resource. When two Doves meet, each gives the characteristic sharing signal and the resource is divided equally, or, perhaps, a fair coin is tossed and the winner gets all. In any case, the expected return to each of the two Doves is V/2. When a Hawk meets a Dove, the Hawk (as it always does) signals fight, the Dove (as it always does) signals share, then the Dove retreats and the Hawk takes the entire resource. Finally, when two Hawks meet, each signal fight, neither retreats, both fight at a cost of C. In the end, the resource is shared equally, minus the cost, or, perhaps, half the time one Hawk gets the entire resource and half the time the other Hawk gets it. In any case, the expected return to each of the Hawks is (V - C)/2.

HawkDove DD
A Nash equilibrium characterizes a situation in which no player has any incentive to change strategy.
Is DD a Nash equilibrium? (DD means that both players play D).

Nash         Not Nash     Nash if V > C     Nash if V < C


HawkDove DH
Is DH a Nash equilibrium?

Nash         Not Nash     Nash if V > C     Nash if V < C


HawkDove HH
Is HH a Nash equilibrium?

Nash         Not Nash     Nash if V > C     Nash if V < C


The solution of the dilemma between two actual players would be to choose a probabilistic strategy. In a population of players, the proportion of hawks stabilizes to a definite value which defines an evolutionarily stable strategy.

Launch Evolife from the Evolife directory with starter. Load the HawkDove.evo configuration. Choose appropriate values for the two parameters V and C (see in the Scenarios/DyadicGames/HawkDove section). Let the program run (button [Run]). Observe the proportion of hawks in the population and the number of peaceful (DD) encounters for various values of the two parameters. The meaning of curves is written in the Legend window.

For what follows, set parameters C and V such that C be significantly larger than V (e.g. 60 and 10).

HawkDove Noise
Open the file (in the directory Scenarii) and locate the hawk() function. As you can see, the effect of noise is to blur the distinction between the two strategies. Set the noise level (in the Configuration Editor, Ecology section) to a significant value (e.g. 30). Observe and explain the effect of noise.


HawkDove Gradual (1)
The Hawk gene is currently coded using 1 bit in genemap. Make it gradual by using more bits (e.g. 10). Now, the gene indicates the probability of being hawk.
Change the hawk function accordingly and copy the modified line in the box below.


HawkDove Gradual (2)
Restore values to default (e.g. relaod HawkDove.evo). What do you observe (you may display the genome window)? How do you explain?


Suggestions for further work

Delayed cooperation

Launch Evolife from the Evolife directory with starter. Load the Cooperation.evo configuration. Let the program run (button [Run]). In the meantime, examine the scenario (in the directory Scenarii) to see how this basic version of cooperation is implemented. Cooperative behavior is controlled by two genes: Cooperativeness and Exploration. The former controls the amount of wealth you give (at your own expense) to partners during encounters. Cooperative acts are rewarded, because if your gift was large enough for partners to remember you, they will choose you as partner when they are in position to make a gift themselves. However, it is in the interest of those partners to explore the rest of the group to see if there are some more generous individuals around. The exploitation/exploration compromise is controlled by the Exploration gene.
Observe the evolution of both genes in the long term. The meaning of curves is given in the Legend window. Wait until cooperativeness significantly drops. How would you explain the phenomenon?


Visualize social links (shortcut ‘n’; you may alternatively uncomment the default_view line in In this view, individuals are displayed twice, on the lower and on the upper horizontal axis. Links connect individuals on the lower axis to individuals to the upper axis. Individuals are ranked by their cooperativeness (most cooperative to the right; see function update_positions ).

Cooperation (2)
From time to time, links are directed towards most cooperative individuals exclusively. On which occasions?


In the section Genetics of the Configuration Editor, change the GeneCoding parameter to Unweighted. Now, the bits of the genes are added up to give its value. A 10 bit gene may therefore have 11 different values, from 0 to 10 (instead of 2^10 = 1024 in the weighted condition). Run the simulation (button [Run]). Is it different? Why? You may visualize genomes (shortcut ‘g’).

In the Genetics section of the Configuration Editor, set GeneLength to 5 instead of 10. Run the program again (button [Run]) and explain what happens.


[ Go to the discussion forum about cooperation ]


Reciprocal cooperation is one of the most studied problems in social sciences, economics and theoretical behavioural ecology, as it is often seen as a foundation of many social conducts. The basic scenario is as follows: The third condition is crucial for cooperation to emerge. With amnesic players, the best strategy would be to let others make the first step and run away with their gift, as reciprocating would be mere charity. But if players can remember who does who does not reciprocate, then reciprocating is a way of being preferentially chosen as partner in the future.
A critical condition for cooperation to emerge is that:     $$ \frac{G R}{C_1 C_2} > 1 + \frac{s(1)}{s’(1)} $$ (see proof there).
s(g2/g2m) is the probability for an individual with gene g2 to be selected as partner in a group in which this gene is on average g2m. The derivative s′(1) measures at equilibrium the marginal efficiency of the ability to detect cooperative agents.

This form of cooperation is still delayed (one agent must take the risk of making the first step), but this time it is the first agent who decides whether it should become friend with the partner.

Modify scenario and implement the interaction. You need to specify two genes to control cooperation, one that controls the amplitude of the first move (g1) and another that controls the amplitude of the response (g2). The function Indiv.best_friend() returns the partner that made the best gift so far. In the interaction section, implement the symmetrical exchange and use the function Indiv.new_friend(Partner, PartnerOffer) that stores an asymmetrical friendship link from Indiv to Partner.

You may choose to reset the agent’s memory periodically, in the start_game function (use Indiv.detach( )). Note that partnership is not eternal anyway, due to natural death and migration. Set parameter Rounds to the number of times each individual will play the game within a season.

To control the second step, you may need to enable two additional parameters in the Configuration Editor. To do so, exit the Configuration Editor, manually edit EvolifeConfigTree.xml with your favourite editor to delete the two parasitic occurrences of the 'XXX' string and restart the Configuration Editor (starter).

Copy the relevant lines of your function in the box below.
You should still observe oscillations between the average values of the two genes. You may try to figure out why it is so.


Forum: forum cooperation
Models of cooperation are fundamentally unstable. In a cooperating world, there is an incentive for cheating. And yet, the human species seems to be characterized by its prosociality and generalized cooperativeness.
You may share your thoughts about this apparent inconsistency.



Back to the main page