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.
There will be four competitions:
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.
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.
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.
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.
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 ...
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.
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.
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.
For competition 1, 2 and 4 we will have, at least, the following strategies represented in the population.
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
|
|
¾
|
4¼
|
3¼
|
2¼
|
1¼
|
¼
|
|
|
½
|
4½
|
3½
|
2½
|
1½
|
½
|
|
|
¼
|
4¾
|
3¾
|
2¾
|
1¾
|
¾
|
|
|
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.
Just for information - these were the original dates for the first competition