# Divide The Cake

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

## WHAT IS IT?

This model (and Cooperation and Altruism) are part of the EACH curriculum: "Evolution of Altruistic and Cooperative Habits: Learning About Complexity in Evolution". See http://ccl.northwestern.edu/cm/EACH/ for more information.

This is an evolutionary game-playing model. Three types of agents must divide a common resource. In the original model it's cake, but let's think of it as edible grass instead, which is green. The agents come in three types: modest, fair, and greedy. The agents move around competing for grass. Agents need grass in order to produce offspring, so over time, the agent types that get more grass will tend to increase in number.

## HOW IT WORKS

When there are only two agents on a patch of grass, each of the agents tries to eat a certain amount of the grass.

There are fair agents (red), modest agents (brown), and greedy agents (blue). Fair agents try to eat half the grass, modest agents try to eat a third of the grass, and greedy agents try to eat two-thirds of the grass.

If the total amount requested by both agents is greater than 100%, then both agents die. Otherwise, each agent gets his requested share of the patch's resources. Each agent then enters a reproduction lottery based on its appetite: The greater the appetite, the greater the chance of reproduction. This factor gives a fitness advantage to the agents with a greater appetite that counteracts the disadvantage of having a greater appetite (viz., the higher chance of asking for too much food and dying).

Each turn, every patch resets to the full amount of grass.

## HOW TO USE IT

SETUP: Creates the agents.

GO: Starts the model running.

MODEST-PROPORTION, FAIR-PROPORTION, GREEDY-PROPORTION: These sliders set the proportions of the three agent types within the initial number of agents. Note that the actual numbers chosen for these three sliders are irrelevant -- only the ratio of the three numbers counts vis-a-vis the setting of the INITIAL-NUMBER slider. For example, the ratio settings "1 1 1" will produce roughly equal numbers of each type, as will the settings "79 79 79" or what-have-you. Likewise, the setting "0 0 1" is no different from "0 0 88", etc.

INITIAL-NUMBER: Creates this number of turtles of all three types together.

TRAVEL-DISTANCE: The value of this variable determines the number of steps an agent moves each turn. This value is the mobility of an agent.

VISCOSITY: This variable is the difficulty of movement. It limits the general mobility of agents.

## THINGS TO NOTICE

If you run the model with the default settings (high viscosity), notice how the population of fair (1/2) agents increases. Why does this happen? Also, notice how the modest (1/3) and greedy (2/3) populations and the modest (1/3) and fair (1/2) populations congregate in dynamically-stable communities but the greedy (2/3) and fair (1/2) populations do not seem to co-exist. Why does this happen?

## THINGS TO TRY

Try changing the population VISCOSITY value. What happens when this value is decreased? How does this affect the survival and the grouping of the different populations?

Change the starting ratios of the populations. How do these ratios affect the behavior of the model? Why should the model depend on these ratios?

Change TRAVEL-DISTANCE. How does it affect the model? What is the relationship between the values of TRAVEL-DISTANCE and VISCOSITY?

## EXTENDING THE MODEL

What environmental variables might affect the model? Should the grass grow back to its full length each turn? How would changing the rejuvenation of available resources affect the model?

Should the agents be informed of each other's anticipated demands prior to making their claims? If they did, then agents could bargain before asking for food, and therefore reduce their chances of death as a result of a joint demand that exceeds the available resources, e.g., 1/2 + 2/3 > 1. This bargaining behavior would change the model drastically, but is an interesting way of exploring how populations may adapt their interpersonal behaviors in order to survive. A question would then arise of whether such survival does or does not ultimately play against agents as a type, because the price of survival could be a depletion of resources in future generations.

## RELATED MODELS

Altruism, Cooperation, PD Basic

## CREDITS AND REFERENCES

This model is based on William Harms's "Divide the Cake" model, described in Brian Skyrms's book "The Evolution of the Social Contract".

Thanks to Damon Centola for his implementation of this model.

## HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

- Wilensky, U. (1997). NetLogo Divide The Cake model. http://ccl.northwestern.edu/netlogo/models/DivideTheCake. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

## COPYRIGHT AND LICENSE

Copyright 1997 Uri Wilensky.

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2002.

## Comments and Questions

turtles-own [ ;; "appetite" will reflect the behavior of the three types of agents: '2' for modest, ;; '3' for fair, and '4' for greedy. Note that the ratio between these three numbers ;; 2:3:4 is equal to the ratio of agent types' eating habits: 1/3 : 1/2 : 2/3. ;; In principle, we could have worked with 1/3, 1/2, and 2/3 but it's just easier to ;; work with integers. So we will think of a whole as "6" and not as "1". appetite ;; true or false for "is it my turn to run the 'eat' procedure?," will help us manage ;; the behavior of turtles who are on the same patch. turn? ] to setup ca ask patches [ set pcolor green ] setup-turtles reset-ticks end to setup-turtles let total (modest-proportion + fair-proportion + greedy-proportion) crt initial-number [ setxy random-xcor random-ycor ;; This will assign proportions of the turtles to agent types ;; according to the ratio of greedy, fair, and modest turtles ;; as set in their respective sliders. The procedure uses the ;; fact that, given enough turtles, the random yet uniform ;; distribution of individual turtles' values from 0 to 1.0 ;; will assign these turtles to different agent types so as to ;; approximate a correspondence with the number of turtles in ;; each type, as determined by the user's ratio settings. let breed-rand random-float 1.0 ifelse breed-rand < (fair-proportion / total) [ set appetite 3 set color red ] [ ifelse breed-rand < ((total - greedy-proportion) / total) [ set appetite 2 set color brown ] [ set appetite 4 set color blue ] ] ] end to go ;; Main loop - agents move around and eat the grass ;; Here all agents receive a 'true' value for their 'turn?' Boolean variable. ;; Later, in the 'eat' procedure, only a single turtle of turtle pairs who are on the same patch will get to use this value. ask turtles [ set turn? true move eat ] tick end to move ;; turtle procedure ;; Agents move in random directions every turn, ;; at least one patch per turn. rt random-float 360 ;; Note that 'travel-distance' is scaled down by the (1 - viscosity) factor, unless 'viscosity' is 0. fd 1 + (travel-distance * (1 - viscosity)) end to eat ;; turtle procedure ;; We need the turn? variable so turtles who are eligible ;; to eat will not get two chances to reproduce. ;; Only where there is exactly a pair of turtles on a patch are both turtles eligible to eat. ;; Logically, we can't manage more than two turtles, because we could not, then, distinguish between ;; the presence of three modest turtles (2 + 2 + 2) or two fair turtles (3 + 3); ;; Also, if appetites on a patch exceeded resources, that is if their total was greater than 6, we would not know if this ;; were because two turtles have gone beyond 6 and they should die, or because there were three or more turtles on the patch. if (count turtles-here = 2 and turn?) [ ifelse (6 >= sum [appetite] of turtles-here) [ ask turtles-here ;; including myself! [ reproduce set turn? false ] ] [ ask turtles-here ;; including myself! [ die ] ] ] set turn? false end to reproduce ;; turtle procedure ;; Note that the higher a turtle's appetite value, the higher are its ;; chances of reproduction. if (random 6) < appetite [ hatch 1 ] end ; Copyright 1997 Uri Wilensky. ; See Info tab for full copyright and license.

There are 20 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

Divide The Cake.png | preview | Preview for 'Divide The Cake' | almost 10 years ago, by Uri Wilensky | Download |

This model does not have any ancestors.

This model does not have any descendants.