The Prisoner's Dilemma Competition

 

If you have arrived at this page by mistake you might like to go to the home page or read more about the prisoners dilemma

You might also want to look at the frequently asked questions page.

The Competitions

There will be four competitions:

  1. A re-run the original experiment of Axelrod. We aim to see if a tit-for-tat strategy still dominates or whether somebody can develop a better strategy taking into account that there has been 20 years since the original competition (for example, tit-for-2-tats was claimed to be better than tit-for-tat) (see results from the first competition and also a set of revised rules).
  2. An identical competition to the one above except there is some (low) probability that there is noise in the data. That is, a signal to cooperate or defect could be mis-interpreted
  3. A competition that allows you to submit a strategy to an IPD that has more than one player and more than one payoff, that is, multi player and multi-choice.
  4. This competition will mirror the original competition of Axelrod. That is, the rules are

If you decide to enter competition 1, you will have the option to also submit this strategy for competition 2 as well.

In addition, we are planning to publish a book, reporting the results of this work. Details as to how to submit to this book will appear shortly.

How to Enter

There are two ways to enter the competitions (web based entry or a java program).

Web Based Entry (Entry Form)

The web based interface can be used for competitions 1 and 2 (see above). The interface will present you with a complete list of previous actions and you decide what you want to do, should that condition arise. For example, assume you only wanted to look back at a history of one. That is you just take into account the last decision made by each player. This gives you four previous actions. These are

Your Last Action
Your Opponents Last Action
Your Next Action?
C
C
?
C
D
?
D
C
?
D
D
?

The web interface will allow you to decide if you want to cooperate or defect when each of these conditions arise.

To show another example. If you wished to consider a history of 2 (the last two actions by you and your opponent0 then you will have 16 choices to make as the complete list of decisions can be summarised as follows.

Your Last Action
Your Penultimate Action
Opponents Last Action
Opponents Penultimate Action
Your Next Action?
C
C
C
C
?
C
C
C
D
?
C
C
D
C
?
C
C
D
D
?
C
D
C
C
?
C
D
C
D
?
C
D
D
C
?
C
D
D
D
?
D
C
C
C
?
D
C
C
D
?
D
C
D
C
?
D
C
D
D
?
D
D
C
C
?
D
D
C
D
?
D
D
D
C
?
D
D
D
D
?

 

If you only want to consider a history of 1 (as above) there are four (22) possible conditions. Using the web interface it will be posisble to consider up to a history of 3; that is the three previous decisions by you and the three previous decisions by your opponent.

Therefore, for up to a history of 3 we have the following number of actions that you will need to provide to the web interface.

If you wish to consider a history longer than 3 then you will need to use the program interface (see below) as 28 (=256) is getting too large to allow submission of a a strategy using a click/point web interface.

Initial States

As there is no history for a time (either 1, 2 or 3 goes) you will also have to supply what you want to do for these initial periods.

If they are working with a history of 1 then you will only need to input 1 initial action (i.e. what do you want to do on the first move, before any history is available to you). Similarly, you will have to input 2 or 3 initial actions, depending on the size of the history you require.

Other Information

In addition to supplying the strategy you will also be asked for some other information including, your name, institution/organistion, EMAIL address, a short (3/4 letters, e.g. TFT) acronym for your strategy, a longer description (e.g. this strategy cooperates on the first moves and then repeats the opponents previous move) as well as the opportunity to write some longer, free format text.

Java Based Interface (Entry Form)

This method of entry can be used for all competitions. Unless you specify otherwise (when you submit your entry) the strategy you submit will be entered for both competition 1 and 2.  Please read instructions carefully.  If you have any questions, please first see the frequently asked questions page or send an email to Graham Kendall.

Competitions 1, 2, 3 and 4 for submitting Java entries will be based on the IPDLX software library.

IPDLX is an extension to the traditional Prisoner's Dilemma software (e g www.giaur.qs.pl/ipdl) but allowing for more flexibility.

Some features ...

Keep in mind that these libraries are, and will be, work in progress until the actual run of the competition. However the interfaces for which you will need to adhere to will hopefully remain static. We welcome any suggestions or queries on the code or documentation.

You can get the library, source, and documentation from the following links ...
To use it, just include the ipdlx.jar in your classpath.

To run the tournament application use one of the following options:

  1. Run the tournament application online
  2. In the same directory as your the 'ipdlx.jar' file type the following command "java -jar ipdlx.jar"
  3. In the same directory as your the 'ipdlx.jar' file type the following command "java -cp ./ipdlx.jar ipdlx.examples.GUITournamentExample"
  4. Under MS Windows, if you have a Java Runtime Environment installed, double click on the 'ipdlx.jar' icon.
We will most likely run the game with the latest release of Java 1.4. Please don't submit any 1.5 or newer class files. Although Jar files are allowed to be submitted please only include those files which are part of your strategy. You don't need to include any of the ipdlx library files.

Competitions 1, 2, 3 and 4

For competitions 1, 2, 3 and 4 all you have to do is follow the instructions in the tutorial to define your own Strategy class. Then you submit this strategy class using the online form. You will be required to submit the java class file or a jar file, as well as supplying various other information including your name, institution/organistion and EMAIL address.
Note that strategy information is also required but this is contained within the strategy class. However, we will provide an additional text box on the form that allows you to submit any additional information that you would like to tell us about.

This is an example of a new strategy which completely defines a new strategy. Comments in red are there to help you - and do not form part of the java source code.  You can download this example file here.

import ipdlx.Strategy;

public class NEG extends Strategy {

You can call your class whatever (legal) name you like. We reserve the right to change it to avoid clashes etc.

Please include a call to super, supplying three pieces of information.
1) The acronym for your strategy (in this case NEG)
2) A longer name for your strategy (in this case Negation)
3) A fuller description

public NEG() {
    super("NEG",
          "Negation",
          "NEG plays according to simple rules: if opponent plays COOPERATION, in next move NEG will play DEFECTION; if opponent plays DEFECTION NEG will play COOPERATION. First move will be random.");

    reset();
}

This is the function that returns your move. Of course, it can be as simple or as complex as you like and you might want to maintain your own state variables

public double getMove() {

    if (opponentMove == DEFECT) {
        return COOPERATE;
    }
    return DEFECT;
}

The reset function is called on the start of every game. Implement it to for example to clear your strategy memory.

public void reset() {
    opponentMove = (int) (Math.random() + 0.5);
}

Some allowable moves are defined in the PDValues class.  We define full cooperation as 1 (or 1.0) and full defection as 0.

Competition 3

To participate in competition 3 you should be aware of some extra features in the Strategy class.

Notice that the getMove returns a "double" value. This is to allow you to return any value for your move in the range [0, 1]. Your move will be rounded off to the nearest allowable move. This will determine your payoff from the given payoff matrix.

A random move in this way can easily be implemented as ...

public double getMove() {

    return Math.random(); // returns a random number in range 0.0-1.0

}

Also you have the choice to make use of the number of players you are facing at the start of each tournament.

public int getNumberOfOpponents()

This will be set at the start of a tournament so by the time the first call to getMove() is made this should have a valid value. If you still would like a guarantee on getting the value just override the setNumberOfOpponents() method ...

public int setNumberOfOpponents(int nrOfOpponents) {
    // YOUR CODE GOES HERE //
    // NOW YOU KNOW THIS VALUE HAS BEEN SET //
    super.setNumberOfOpponents(nrOfOpponents);
}


Please see the payoff matrix below for a multi-choice game.

Time Limits

In order to ensure that the competition does not "hang" we will be imposing a time limit on the amount of time you have to make a move. Of course, we could get into debates about what is time and how are we going to measure it?" However, this would be too complicated so we are simply going to say that we will impose a time limit of 2 seconds for a move. If you have not responded in that time then we will terminate that game. You will receive zero points and your opponent will receive the point sthey have accummuated thus far.

We are also aware that some people want to "link" to the outside world (to link to a faster machine, for example). We have said that this is allowable but you need to tell us if your strategy is going to do this (as we'll have to make sure that the competition machine is linked to a newtork).
In these cases we will allow 20 seconds per move (and that is open to negotiation) but we may have to run a separate competition when these oppoenents are involved as we may have to run on a desktop macine at one of our institutions as we may not have a link to a network at CEC. In nay case, we will run these strategies against ALL the others to give a fair competition.
In any case, we plan to run a variety of competitions, using variable set-ups, so that we can carry out as much research as possible.

Other Information

Default Strategies

For competition 1, 2 and 4 we will have, at least, the following strategies represented in the population.

 

Payoff Matrices

The payoff matrix we will use for competition 1, 2 and 4 is as follows.


Cooperate
Defect
Cooperate

R=3

T=5
R=3

S=0

Defect

S=0

P=1
T=5

P=1

We may also experiment with other matrices, just for fun!!, but this is the one we will use to find the overall winner of the competition.

 

The payoff matrix, for varying levels of cooperation, we will use for competition 3 is as follows.

 

   
Player B

Levels of Cooperation
1
¾
½
¼
0
Player A
1
4
3
2
1
0
¾
¼
½
½
¼
¾
0
5
4
3
2
1

In this matrix, each player is allowed to vary their level of coopeeration between 0 (no cooperation) to 1 (full cooperation). The payoffs are shown as received by player A.

For example, if Player A fully cooperates and Player B fully defects then A will receive a payoff of 0. Player B would receive a payoff of 5.

Another example, player A cooperates ¼ and player B cooperates ½ would result in a payoff of 2¾ for player A and a payoff of 1½ for player B.

Note that the four corners of this matrix are, themselves a prisoners dilemma and the other values are interpolated from the 2-choice game. Also note that any 2x2 matrix is itself a prisoners dilemma.

 

Important dates

Just for information - these were the original dates for the first competition


Page hits (since 7th November 2003) :