User Tools

Site Tools


env-model:classes:first2014:finalproject:cooperation

[back]

COOPERATION


WHAT IS IT?

The model is representing the competition between individual organisms (cows) for a common resource (grass). There is two types of individuals: Cooperative and greedy ones. Cooperative individuals accept a personal disadvantage to do something good for the whole group (for the “greater good”). Greedy individuals maximize their personal benefit disregarding the needs of the rest of the group.

The model helps to understand which of these two strategies are more successful under different circumstances. The user can explore various settings (initial number of each type of individual, availability and regrowth of the common resource, disease and varying resistence against it, …) to observe the performance of the two types in the competition.

The model is representing cows and grass, but the individuals could be any type of agent that competes against others for a common resource (in space and time), and that comes in two types with different strategies. The resource, too, could be something else, as long as it is regenerating and spatially available.

Possible measures for performance are: Number of individuals over time, fitness of the individuals over time, survival duration of one group and/or amount of resource available or consumed.

HOW IT WORKS

The model space is a rectangular area composed of regular square cells. The cells contain the resource, the 'grass', whose amount is represented by a number. In time, this resource grows according to a growth rule. It adds a predefined number of resource units (grass height) to the cell. The rule specifies two different rates (?) of growth: Slower growth before reaching a predefined threshold, and then faster growth, up to a predefined maximum.

The agents ('cows') are located in this area. In each time step, they consume a predefined portion of the resource and gain a specific amount of energy from this. At the same time, they lose energy through metabolism. Once they reach a threshold, they reproduce. If their energy level reaches zero, they die. During the simulation, the cows move around in space randomly to find food.

Two types of agents are present. The cooperative cows only eat grass above a certain threshold. Greedy cows eat the grass, no matter its height. Shorter grass has a lower chance of regrowth and grows more slowly (true?), so by eating the grass until it is gone, the pasture is strongly degraded and produces less new food per time step. Thus, this behaviour is not advantageous for the whole herd. A cooperative cow does not eat if the grass is not above the threshold. Thus, it takes a personal disadvantage.

Obviously, when both types of cows are present, the egoist ones will quickly eat the grass down to below the threshold, keeping the cooperative ones from eating. The cooperative cows quickly die out. When only one type is present, the pasture can feed more cooperative ones than greedy ones.

For giving the cooperative cows some advantage over the egoist cows, it is possible to turn on various advantages (see model parameters) that become relevant when the food situation is relatively good. The user can play with them to find out how they affect the balance between both populations.

Another extension of the original Cooperation model is the parasites. It is possible to introduce a parasites epidemia by inserting a certain amount of initial infections and then watch the parasites spread over the herd (lighter colours on the map). Parasites are spread then an infected cow meets other cow (location in same cell). The likeliness of transmission depends on the energy level of the healthy cow. The result of an infection is that the cow loses much more energy per time step, thus it needs to eat more, and can reproduce less. If it reaches a certain energy level, the cow is cured from the parasites.

HOW TO USE IT

Please download the model code (*.lua file). In the beginning of the file, a table called “options” includes the parameters and initial conditions for the simulation as well as some general settings (should observers be shown, for how many time steps should the simulation be run etc.). Adapt as many of these options as you want. Values that are not specified by the user will be set to default values.

For the proper display of the agents on the map, the font Animals (see http://www.ecofonts.com/download-free-font/animals2.aspx) has to be installed (otherwise, the agents will be shown as the letter “N” on the map, but this does not affect the functionality). The font is available for download at the website “http://www.ecofonts.com/download/download.ashx?d=935310”.

The parameters you can use are the following:

Initial settings:

  • initial_cows: How many cows will be there initially? (Default: 10)
  • cellspacesize: What size will the space have? Give the number of cells in x and y direction (Default: 20)
  • cooperative_probability: What fraction of cows will be greedy or cooperation, in the beginning? (Default: 0.5)
  • number_greedy_beginning: You can specify the exact number of greedy or cooperative cows in the beginning. If this parameter is set (to an integer value), the previous one is ignored. To ignore this parameter, set it to “false”.

The cows:

  • grass_energy: How much energy does a cow gain by eating one unit of grass (Default: 50)
  • metabolism: How much energy does a cow lose through its metabolism per timestep (Default: 40)
  • reproduction_threshold: At which energy level will it reproduce? (Default: 300)
  • reproduction_cost: How much energy will the cow lose when it reproduces? (Default: 50)
  • stride_length: How far does a cow walk in each time step? (Default: 1)

Possible advantages that cooperative cows could have:

  • energylevel_for_advantages: Which energy level does a cooperative cow need to have these advantages? The idea is that while greedy cows perform better when resources are scarce, the cooperative cows might have an advantage when the food situation is good. (Default: 200)
  • advantage_lose_less_in_reproduction: Should a cooperative cow lose less energy when it gives birth to a calf? (Default: false)
  • advantage_lose_less_in_metabolism: Should a cooperative cow lose less energy in metabolism per time step? (Default: false)
  • advantage_can_eat_more: Should a cooperative cow be able to eat more grass in the same time? (Default: false)
  • advantage_gets_more_energy_from_food: Should a cooperative cow gain more energy from the same amount of food? (Default: false)
  • advantage_more_resistant_to_parasites: Is a cooperative cow more resistant to parasites? (Default: true, but parasites are not included by default)

The grass:

  • low_high_threshold: After which height threshold does grass start to grow faster? (Default: 5)
  • high_growth_chance: What is the probability that high grass will grow in a certain timestep? (Default: 0.9)
  • low_growth_chance: What is the probability that low grass will grow in a certain timestep? (Default: 0.3)
  • max_grass_height: What is the maximum height for grass? (Default: 10)

Simulation options:

  • wait: How much time the simulation should stop and wait per timestep, in seconds (e.g. 0.5 seconds, so the user can more easily follow what is happening on the map. If no waiting is desired, put “false”). (Default: false)
  • printbirthdeath: Should information about births and deaths be printed to screen? (default: true)
  • randomseed: If desired, a seed for the random number generator can be put, in order to reproduce results (Default: false)
  • store_resultfiles: Should the results be printed in text files? (Default: false)
  • path_for_resultfiles: Please specify a path to the directory where the result *.txt files will be stored. Default: None (thus the files will be stored in the current directory).

Which observers should be displayed during model run? This depends on the modeller's goals and the need for high computation speed.

  • observe_map: Should the grass and agents be shown on a map?
  • observe_cownumbers: Should the numbers of cows (differentiated by behaviour) be plotted as a chart?
  • observe_grassenery: Should the units of grass be plotted as a chart?
  • observe_cowenergy: Should the energy of the cows (differentiated by behaviour) be plotted as a chart?
  • observe_grass_and_cows: Should the number of cows (differentiated by behaviour) and units of grass be plotted in one chart, so that prey and predator patterns are easy to see? (For this, the grass units will be divided by a constant, to allow for easier comparability).
  • observe_parasites = Should the fraction of infected cows (differentiated by behaviour) be plotted as a chart?
  • observe_averagecows: Should the energy level of an average cow (differentiated by behaviour) be plotted as a chart?
  • observers: This parameters allows for switching all the observers off at the same time. (Default: true)
  • killobservers: Should the observers be killed at the end of a model run, to allow running the model again (e.g. in Monte Carlo simulation), instead of waiting for the user to close them? (Default: false)

Parasites:

  • parasites = false: Should parasites be simulated? (Default: “false”, so no!)
  • parasites_start: In which timestep should the parasites enter the simulation? (Default: 1)
  • parasites_number: How many cows should initially be infected? (Default: 1)
  • parasitenenergyloss: How much energy (fraction of a cow's energy, from 0 to 1) does a cow lose per time step, once it is infected? (Default: 0.15, so 15 %)
  • healthycow_level: At what energy level is a cow cured from the parasites? (Default: 350)

THINGS TO NOTICE

While running the model, pay special attention to the development of both populations relative to each other and relative to the amount of available grass. Can you identify any pattern? Do the patterns differ if only cooperative or only selfish agents are present? An interesting chart to watch is the average energy of the agents, as it is not visible neither in the population number nor on the map.

Also, pay attention to the spatial density of agents in areas dominated by cooperative or selfish agents. Is the support capacity of the whole area the same or not?

THINGS TO TRY

  • Initially put a fixed number of agents with varying percentages (0%, 1%, 50%, 99%, 100%) of cooperative and selfish behaviour and see for how much time both populations coexist.
  • Vary the distance that an agent can walk per time step (from 0.1 to 1.5) and observe its effect on the populations.
  • Play with parasite epidemics.

EXTENDING THE MODEL

The model could be made more realistic by adding features such as cows' gender (thus only allowing the females to reproduce, possibly only if a suitable mating partner is available and spatially close) or a maximal age (so far, a cow that finds enough food can survive eternally). The growth rates of the grass could be made more realistic, i.e. not linear with a sharp bend after reaching a threshold.

An important feature would be to make the cows' movements in space less random. A random movement is unrealistic, as the cows would always move in direction of the food. A cow moving from a spot that has a lot of resource available to a poor spot is not realistic. Furthermore, it would be interesting if a herd behaviour (cows moving in direction of the others, like a bird flock) would alter the results.

For more possible extensions, please consider the web page of the model this implementation was based on: http://ccl.northwestern.edu/netlogo/models/Cooperation. It suggests introducing more different types of behaviour and environmental conditions. A very interesting extension suggested on the web site is the introduction of learning: The behaviour changes over time, depending on environmental conditions or other variables.

TerraME FEATURES

A very important part of this model is the movement of the animals. Animals staying in the same cells and thus degrading its resources, or moving to another cell in order to find better food conditions, are the variable with the largest effect on the population dynamics. To allow a more fine-grained tuning of this parameter, I decided to use decimal numbers as coordinates instead of the integer coordinates of the cells. This way, small movements (< 1 unit) can be simulated, and the agent changes cells only when the next movement would lead them to the space covered by a neighboring cell. Thus, I did not use the Neighbourhood, the neighbourhood sampling or move functions provided within TerraME. However, I think the behaviour I intended to introduce by this workaround could have been achieved using the available Neighbourhood, sampling and moving functions by adding probabilities of moving to another cells.

Features that are very useful for model observation are rounding, waiting and statistics functions. A waiting function allows to run the simulation slower for the modeller to observe it, or to wait only at specific events (e.g. when all individuals of a certain type have been killed). A statistics function could provide the modeller with the total number of agents of a certain type (with specific attribute values) or with averages of (subgroups of) agents' attributes at any time. Also, allowing the colour bars for equal steps to have various colours (e.g. red to white from 0 to 1, and then white to blue from 1 to 20; or white to green for >0 to 10, and red for any cell with exactly 0) would be very helpful.

A function for making it easier to run the model many times and store the different results (Monte Carlo simulation) would be welcome.

The feature that I missed most was a possibility to observe the conjunto of a population, for example by aggregating statistics (mean and standard deviation of a certain attribute) or by plotting the interval of it over time.

The Altruism model on the NetLogo website (http://ccl.northwestern.edu/netlogo/models/Altruism) explores similar concepts. Again, the performance of altruist entities competing against more selfish entities is modelled. They compete for space with other entities, while their fitness and their altruism/selfishness affect their likeliness of obtainind a particular spot.

To a certain extent, prey-and-predator models are related to this model. Depending on the input parameters, the model sometimes displays a prey-and-predator pattern (the amount of cows varying proportionally to, but temporarily slightly shifted from the amount of available grass). This tends to occur especially when there is a high amount of agents of the selfish type which have already eliminated the cooperative type.

CREDITS AND REFERENCES

The model documented on this website was implemented as part of the university class “Environmental Modelling” taught by Prof. Dr. Tiago Carneiro in Münster in August 2014, based on the model Cooperation by Uri Wilensky (Copyright 1997 Uri Wilensky), whose implementation is available on the web (Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License) using the modelling tool NetLogo (http://ccl.northwestern.edu/netlogo/models/Cooperation).

Credits for this work:

env-model/classes/first2014/finalproject/cooperation.txt · Last modified: 2014/10/02 13:47 by tiago