Anti-Coordination Game

Anti-Coordination Game preview image

2 collaborators

Default-person Amanda Page (Author)
Default-person Darin England (Advisor)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 236 times • Downloaded 21 times • Run 0 times
Download the 'Anti-Coordination Game' modelDownload this modelEmbed this model

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


## WHAT IS IT?

This model is an implementation of an anti-coordination game when players are arranged in a network. Each agent can choose one of two possible actions: action A or action B.

Each agent will attempt to maximize her own payoff by anti-coordinating her action with the actions of her neighbors. The purpose of the model is to understand the conditions under which an equilibrium exists.

## HOW IT WORKS

Agents play an anti-coordination game with each neighbor. Agents recieve the sum of the payoffs. The game is:

```

A B

--------

A | AA AB

B | BA BB

```

The rule for anti-coordination is the value of the payoffs must follow that BA > AA and AB > BB. Before taking an action, agents check to see how many of neighbors are taking action A and how many are taking action B. Each agent then chooses the action (either A or B) that will maximize her own total payoff. Initially all agents are set to take action B. The user can select which agents will (at least initially) take action A. The agent then plays her selected strategy with all of her neighbors. Equilibrium only occurs under certain conditions (please see the article by Bramoulle that is referenced below).

The color of an agent indicates which action is currently beging taken. Black indicates action B and white indicates action A.

## HOW TO USE IT

SETUP sets all agents to take action B in the generated network.

When GO ONCE is pressed, agents play the coordination game one time. Pressing GO causes the agents to play the game repeatedly (at each tick).

The NUM-NODES slider allows the user to drag the slider between 2 and 15 to select the number of nodes in the network.

The SELECT NODES button allows the user to select agents with the mouse. The selected agents will take action A (at least initially). The 'selected node' box will show the number of the turtle the mouse is hovering over while selecting nodes.

RESET STATES will reset all agents to take action B in the current network. The difference between this and SETUP is the setup button will generate a new network with new links.

The PAYOFF MATRIX has 4 boxes that allow the user to enter their desired payoff values for the anti-coordination game. The payoff values must follow that BA > AA and AB > BB. If the values do not meet these requirements, an error message will pop up and the values must be changed to meet these requirements.

The ADD NODE button allows the user to click and add a node to the network and create links to the nearest nodes. The DELETE NODE button allows the user to click and delete a node, along with its links, from the network.

## THINGS TO NOTICE

Bipartite networks are the only networks on which agents can anti-coordinate with all of their neighbors.

## THINGS TO TRY

Try to find conditions under which equilibrium occurs. How does the structure of the network effect the equilibrium that does occur?

## NETLOGO FEATURES

Networks are represented using turtles and links. The user is able to use the mouse to select the agents that initially take action A.

The user is able to use the mouse to add nodes to the network by clicking where they want the new node. The user is also able to delete nodes from the network by using the mouse to select the node they want to delete.

## CREDITS AND REFERENCES

This model is an implementation of some ideas that are described in Yann Bramoulle, Anti-coordination and social interactions, Games and Economic Behavior, vol 58, pp 30-49, 2007.

## HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

* Page, A. and England, D. (2020). NetLogo Anti-coordination Game.

https://github.com/bx549/ABM

Please cite the NetLogo software as:

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

## COPYRIGHT AND LICENSE

Copyright 2020 Darin England

![CC BY-NC-SA 3.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)

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

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

; the anti-coordination game

globals [
  selected
  turtle1
  turtle2
  mylist
  payoff1
  payoff0
  changeoccured
  counter
  ]

turtles-own [
  action        ; action (either 0/B or 1/A)
  orig-action   ; each person's initially assigned action
  action-1-sum
  action-0-sum
]

to setup
  clear-all
  set-default-shape turtles "circle"
  ask patches [ set pcolor cyan + 1 ]
  set selected nobody
  check-payoffs
  make-turtles
  distribute-actions
  create-network
  select-nodes
  delete-nodes
  add-nodes
  ;delete-link
  reset-ticks
end 

to check-payoffs
  if BA < AA [
    user-message (word "The value for BA must be greater than AA. Enter different values and click 'setup' again.")]
  if AB < BB [
    user-message (word "The value for AB must be greater than BB. Enter different values and click 'setup' again.")]
end 
; create the turtles in 1-dimensional lattice

to make-turtles
  create-turtles num-nodes [
    set color black
    set action 0 ]
  repeat 50 [layout]
  ask turtles [ setxy 0.95 * xcor 0.95 * ycor ]
end 

to layout
  layout-spring turtles links 0.5 2 1
end 


; initialize some individuals to start with action 1

to distribute-actions
  ask turtles [ set action 0 ]
  ask turtles [
    set orig-action action
    update-color
  ]
end 

to update-color
  set color ifelse-value action = 0 [black] [white]
end 
; action 0 =B=black, action 1=A=white

;; create the links in the 1-dimensional lattice

to create-network
  ask turtles [
    let nbrs other turtles in-radius 10
    ; other omits the turtle itself
    create-links-with nbrs [ set color white ]
    ; only one undirected link between any two turtles is created
  ]
end 

to reset-nodes
  clear-all-plots
  ask turtles [
    set action orig-action
    update-color
  ]
  reset-ticks
end 

to redistribute-actions
  clear-all-plots
  distribute-actions
  reset-ticks
end 

to go
  ask turtles [check-neighbors]
  take-action
  ask turtles [ update-color ]
  tick
  ;debg-actions
end 

to debg-actions
   ; debugging, show actions of all nodes
  foreach sort-by[ [a b] -> [xcor] of a < [xcor] of b ] turtles [ i ->
    ask i [ show action ]
  ]
end 

to check-neighbors
  set action-1-sum sum [action] of link-neighbors
end 

to take-action
  set counter (0)
  loop [
    set changeoccured (false) ;detect if agents changed their action
    set counter (counter + 1)
    foreach sort-by[ [a b] -> [xcor] of a < [xcor] of b ] turtles [ i ->
      ask i [
        let previousaction [action] of i ;store agent's previous action
        let num-neighbors count link-neighbors
        check-neighbors
        set action-0-sum (num-neighbors - action-1-sum)
        set payoff1 (action-1-sum * AA + action-0-sum * AB)  ; if agent takes action 1
        set payoff0 (action-1-sum * BA + action-0-sum * BB)  ; if agent takes action 0
        set action ifelse-value payoff1 >= payoff0 [1] [0]
        if previousaction != action [set changeoccured (true)]
      ]
    ]
    if changeoccured = false [stop]
  ]
end 

to select-nodes ; use the mouse to select which nodes take action 1
  set selected min-one-of turtles [distancexy mouse-xcor mouse-ycor]
  if mouse-down? [
    ask turtles with [distancexy mouse-xcor mouse-ycor < 2] [
      set action 1
      update-color
      display ; update the display
    ]
  ]
  set selected nobody
end 

to add-nodes
  if mouse-down? [
      create-turtles 1 [
        set color black
        set action 0
        setxy mouse-xcor mouse-ycor
        let nbrs other turtles in-radius 10
        create-links-with nbrs [set color white]
    ]
    stop
    ]
  display ; update the display
end 

to delete-nodes
  if mouse-down? [
    ask turtles with [distancexy mouse-xcor mouse-ycor < 2] [
      die
      display ; update the display
    ]
    stop
  ]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Amanda Page over 3 years ago Update info tab Download this version
Amanda Page over 3 years ago Updated info tab Download this version
Amanda Page over 3 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Anti-Coordination Game.png preview Preview for 'Anti-Coordination Game' over 3 years ago, by Amanda Page Download

This model does not have any ancestors.

This model does not have any descendants.