Home
Help
Resources
Extensions
FAQ
NetLogo Publications
Donate

Models:
Library
Community
Modeling Commons

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

## NetLogo User Community Models

FriendshipGame Rev. 1.0

WHAT IS IT?

This is a friendship game model. A friendship game is a kind of network game: a game theory model on a network. A game starts with a model of a network of turtles. Each turtle considers as its friends every other turtle that is linked directly on the network. Each turtle decides what strategy to play, x or y, based on the choices made by its friends. How the friends influence the choice depends on whether the game is one of strategic substitutes or strategic complements.

A strategic substitute is something that, if one of its friends is already doing it, a turtle has no reason to also do it. For example, if a turtle gets a pickup truck, all its friends can borrow it, so they have no need to buy one, too.

A strategic complement is something that, if a majority of its friends are doing it, a turtle will also do it. For example, if the majority of a turtles friends are using NetLogo, then the turtle has an incentive to also use NetLogo.

This project is based on friendhip game models introduced by PJ Lamberson in a presentation in the Agent-based Computation Economics sessions of the Eastern Economics Association conference in February 2011.

HOW TO USE IT

In most cases you'll want to set the speed slider all the way to the FASTER end.

Choose the NUMBER of turtles. The smaller the number, the less time it takes to build the network, but the less interesting the outcome.

Choose the NUMBER-OF-FRIENDS for each turtle. This is the mean degree of each turtle, which means the average number of friends a turtle will have. Depending on the network topology, that actual number for any given turtle may differ considerably from this. NOTE: the perferential attachment network topology always yields a NUMBER-OF-FRIENDS of about two. In this case, NUMBER-OF-FRIENDS is only used in the payoff calculation. See the STRATEGIES section for information about this.

Set the TURTLE-CHOOSER to "Choose randomly" to let a single turtle, chosen at random, decide whether to play X or Y at each tick. "Cycle through all randomly" shows what happens if every turtle gets one chance to decide strategy before cycling through all the turtles again.

Use the STRATEGIC-MODEL to set whether turtles play a strategic substitute or a strategic complement. See the STRATEGIES section for more about this.

Set NETWORK-TOPOLOGY to one of topologies described in NETWORK TOPOLOGIES section.

Click the SETUP button. This will create the network, which may take a long time, depending on topology, NUMBER of turtles, and NUMBER-OF-FRIENDS. When it's done, the graph will be updated with a representation of the network, but this will not be very informative, usually. Also, when SETUP is done, the network monitors will be updated. See the section on NETWORK MONITORS for information about these.

Set the CUTOFF-TIME to the tick at which you want to stop each simulation.

Set the PEER-PRESSURE. This is the fraction of a turtle's friends that will influence the turtle. See the STRATEGIES section for information on this parameter.

Click the GO button to start the simulations. The % PLAYING X will start at different levels, and will change over time based on the STRATEGIC-MODEL. See the THINGS TO NOTICE section. You can click the GO button again at any time to suspend the simulation. While the simulation is running, the runtime monitors will be updated. See the section on RUNTIME MONITORS for information about these.

NETWORK TOPOLOGIES

These are the topologies currently implemented:

"regular-random-network" - A regular network is one in which each turtle has exactly the same number of friends, NUMBER-OF-FRIENDS.

"Erdos-Renyi-random-network" - This is kind of Bernoulli random network, in which each turtle has a different number of friends. The number of friends (the degree) of each turtle comes from a binomial distribution with a mean of NUMBER-OF-FRIENDS. This project constructs an Erdos-Renyi random network by adding connections between random pairs of turtles until the mean degree is equal to NUMBER-OF-FRIENDS.

"Gilbert-random-network" - This is another kind of Bernoulli random network. This project constructs a Gilbert random network by looping over all possible pairs of turtles and creates a connection between them with probability p = NUMBER-OF-FRIENDS / NUMBER.

"preferential-attachment-network" - This is a network model from the Perferential Attachment model in the NetLogo Models Library. The network is constructed by creating new turtles and connecting them to other turtles, with a preference for turtles that have more connections. This results in a power-law (scale-free) distribution with an exponent of about -2.

STRATEGIES

In game theory, a player's choices are called strategies. In this project, the turtles (players) have strategies based on the strategies being played by their friends on the network. In each case a turtle has the choice between playing strategy X and strategy Y.
How the turtle makes the decision based on strategy type.

"Strategic-substitute" - A strategic substitute is something that, if one of its friends
is doing it, a turtle has no reason to also do it. For example, if a turtle gets a pickup truck, all its friends can borrow it, so they have no need to buy one, too. A turtle will
play strategy X only if fewer than a threshold number of friends are playing it. Otherwise, the turtle plays strategy Y. The threshold is PEER-PRESSURE * NUMBER-OF-FRIENDS.

"Strategic-complement" - A strategic complement is something that, if a majority of its
friends are doing it, a turtle will also do it. For example, if the majority of a turtles friends are using NetLogo, then the turtle has an incentive to also use NetLogo. A turtle will play strategy X only if more than a threshold number of friends are playing it. Otherwise, the turtle plays strategy Y. The threshold is PEER-PRESSURE * NUMBER-OF-FRIENDS.

NETWORK MONITORS

These are monitors on the network topology:

CLUSTERING - this is the clustering coefficient (Newman, 2010). This is the probability that any two of a turtles friends are also friends with each other.

DEGREE - this is the current average (mean) degree for all the turtles. When SETUP is clicked, this will start at zero and increase until it's approximately the same as NUMBER-OF-FRIENDS.

NUMBER OF LINKS - this is the total number of links between turtles.

DEGREE HISTOGRAM - this is a histogram of turtle degrees. The number of turtles with the given degree is shown as a bar, and the theoretical distribution is shown as a red line.

R SQUARED - this is the R-Squared metric for the degree histogram. This is the closeness of fit between the bars and the red line.

RUNTIME MONITORS

These are monitors on the simulation:

% PLAYING X - The percent of total turtles currently playing strategy X. Turtles playing X are shown red, while those playing Y are shown green.

PERCENT PLAYING X timeseries plot shows the results of the simulations so far, for each starting percentage.

THINGS TO NOTICE

When you execute SETUP, DEGREE will increase. The NUMBER OF LINKES will also increase. CLUSTERING will increase, but not by much.

When SETUP is done (the button is no longer dark), DEGREE should be very close to NUMBER-OF-FRIENDS. NUMBER OF LINKS will be in the neighborhood of 0.5 * NUMBER * NUMBER-OF-FRIENDS.

When you execute GO, % PLAYING X will start at a low value and the PERCENT PLAYING X timeseries graph will track it as it changes. When TICKS is equal to the CUTOFF-TIME, a new graph will start at a new % PLAYING X value. For a strategic substitute, the starting values of % PLAYING X range from 10% to 90% in steps of 10%. For a strategic complement, the starting values of % PLAYING X range from 10% to 50% in steps of 5%.

For a strategic substitute, all starting values will converge to about the same value (equilibrium) within about 1000 ticks.

For a strategic complement, lower starting values will converge to zero (lower equilibrium), and higher starting values will converge to 100% (upper equilibrium), some taking a more than 4000 ticks.

For a strategic substitute, the equilibrium value is different for different network topoligies.

For a strategic complement, the dividing line between starting values that go to the upper equilibrium versus the lower equilibrium is different for different network topoligies.

THINGS TO TRY

See how changing the network topology changes the outcomes.

See how reducing the NUMBER of turtles affects the outcome. (You can try increasing it, but building the network can take a long time!)

See how changing the NUMBER-OF-FRIENDS affects the outcome. (Here, again, increasing can increase the time by quite a lot.)

See what happens when you change the TURTLE-CHOOSER.

EXTENDING THE MODEL

These turtles are all the same and they're all rational. A next step would be to add behaviors based on a variety of payoffs, or on non-rational behavior, or on global knowledge. For example:

What if some turtles won't change their minds no matter what their friends are doing?

What if some turtles change their minds all the time, even if all their friends come to an equilibrium?

What if some turtles are really good at guessing the equilibrium and go there sooner?

What if some turtles are contrarians, doing the opposite of whatever the majority of turtles are doing?

CREDITS AND REFERENCES

Lamberson, P.J., http://andromeda.rutgers.edu/~jmbarr/EEA2011/lamberson.pdf

Newman, M. E. J., Networks: An Introduction, Oxford: Oxford University Press, 2010.

Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Wilensky, U. (2005). NetLogo Preferential Attachment model. http://ccl.northwestern.edu/netlogo/models/PreferentialAttachment. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

HOW TO CITE

If you mention this model in an academic publication, we ask that you include the following citations.

For the model itself:
- Dixon, David S. (2011). Friendship Games.

For the NetLogo software:
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:
a) these copyright notices are included.
b) this model will not be redistributed for profit without permission from David S. Dixon. Contact David S. Dixon for appropriate licenses for redistribution for profit.