Skip to content

Commit

Permalink
Merge branch 'master' of github.com:vjeux/GameTheory
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeux committed Jan 10, 2012
2 parents 70db82a + cca2f30 commit 954a5f1
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
@@ -1,7 +1,7 @@
Game Theory
===========

In order to start your implementation, you can use the dumb bot [Bot_Coop.py](https://github.com/vjeux/GameTheory/blob/master/bots/bot_coop.py) as a base. It's written in Python.
In order to start your implementation, you can use the dumb bot [bot_coop.py](https://github.com/vjeux/GameTheory/blob/master/bots/bot_coop.py) as a base. It's written in Python.

Installation
============
Expand Down Expand Up @@ -34,6 +34,40 @@ Test your bot against the others (ping me if the server isn't up):
python bots/yourbot.py fooo.fr 1337
```

Game
====

Phase 1 - [Prionnier Game](http://en.wikipedia.org/wiki/Prisoner%27s_dilemma)
---------

Each player either Betray ```T``` or Cooperate with ```C``` every other player. It can be seen as a nice complete graph like this:

<img src="http://fooo.fr/~vjeux/epita/game-theory/images/prionnier_1.png" width="400px" />

Those links are used to group players together. We discard every relation but both-sides cooperation ```CC``` and connected components are forming groups.

<img src="http://fooo.fr/~vjeux/epita/game-theory/images/prionnier_2.png" width="380px" />

Within each group, we calculate a bounty. It is the sum of all the internal links costs: ```CC``` = 10, ```TC``` = 4 and ```CC``` = 1.

<img src="http://fooo.fr/~vjeux/epita/game-theory/images/prionnier_3.png" width="380px" />

Phase 2 - [Pirate Game](http://euclid.trentu.ca/math/bz/pirates_gold.pdf)
------

A Pirate game is started on each group with the previously calculated bounty. Players (now Pirates!) are sorted by score. The one with the biggest score is the Pirate leader. He has to propose a share of the bounty between all the pirates.

<img src="http://fooo.fr/~vjeux/epita/game-theory/images/pirate_1.png" />

Each pirate vote if he accepts the share or not.

<img src="http://fooo.fr/~vjeux/epita/game-theory/images/pirate_2.png" />

If the leader doesn't get at least half of the votes, he is thrown overboard and the next pirate on the list is now the leader. The fallen leader has to swim back to the ship and therefore will not participate to the next Prisonnier Game.

Once a share is approved, the score of each player increases by the amount agreed upon. Then, a new Prisonnier game starts over.


Example
=======

Expand Down

0 comments on commit 954a5f1

Please sign in to comment.