**************************************************** * evolution of cooperative behavior * through iterated prisoner's dilemma simulations **************************************************** --- what is this ------------------------------------ This is a sample project for a "Programming Workshop" course that implements "players" in a prisoner's dilemma simulation. With a pool of players using different strategies, one can search for the best strategy by an evolutionary algorithm that weeds out players that do poorly while adding in new players similar to those that do well. Or at least that's the goal. See http://en.wikipedia.org/wiki/Prisoner's_dilemma for a discussion of what this problem and references to Robert Axelrod's 1984 analysis. The vocabulary I use is from wikipedia's entry as of March 15 2007. Jim Mahoney (mahoney@marlboro.edu) Marlboro College Spring 2007 --- using it --------------------------------------------- Either use the scripts : $ ./compile $ ./Tests $ ./PrisonersDilemma Or invoke java commands directly : $ javac *.java $ javadoc -d docs *.java $ java edu.marlboro.cs.prisoner.Tests $ java edu.marlboro.cs.prisoner.PrisonersDilemma --- files ------------------------------------------------------- readme.txt this overview history.wiki diary notes Game.java Player.java RandomPlayer.java TrivialTestEngine.java Tests.java contains main() for tests docs/ API created by javadoc edu/marlboro/cs/prisoner symbolic link to . (to keep java happy) compile* script to compile and make docs Tests* script to run the Tests class (coming ??) Arena.java collection of players, run against each other PrisonersDilemma.java contains main() PrisonersDilemma* script to run the PrisonersDilemma class --- my package and directory structure ------------------------ All the .java files here are in the package edu.marlboro.cs.prisoner. Since the java compiler therefore expects to find them in edu/marlboro/cs/prisoner, but I want to leave them here in this project directory (no matter where that happens to be), I've created a symbolic link that loops back here. Creating the symbolic link: $ export ROOT=`pwd` $ mkdir -p edu/marlboro/cs $ cd edu/marlboro/cs $ ln -s ../../.. prisoner Then to compile and run the tests, for example. $ javac *.java $ java edu.marlboro.cs.prisoner.Tests Having "." and "edu/marlboro/cs/prisoner" both refer to this same directory is of course a total kludge, but java doesn't leave me a lot of good choices. I've never liked java's package system and assumptions about class and file names; this is an example of why. --- subversion and rsync ----------------------------------------------- I'm using subversion to archive all these files, which is what's providing the version strings like the ones below. The sorts of commands issued to archive the files are things like. $ svn add SomeRandomFile.java $ svn commit -m "added SomeRandomFile" I've also set up a script (which runs manually from the laptop) to keep this project consistent between the server and my laptop, so I can work on it in my office or from home. ------------------------------------------------------------------------- $Id: readme.txt 12775 2007-04-17 15:23:12Z mahoney $