IA168 Algorithmic Game Theory

Project

In the study materials, you can find the following files:

  • tournament.cpp: the main code which simulates the tournament
  • tournament.h: the header file which you should include in your cpp file
  • sampleAIs.cpp: 5 examples of simple (and not very good) AIs

You are expected to submit a cpp file which implements a function called something like AI_YourSurname. The prototype of this function is int AI_YourSurname(int op, int b, int state, int d). The meaning of the parameters is as follows:

  • op: id of your opponent
  • b: the current value of the game parameter B (how many chips a player bets)
  • state: the current state of the "hand": an even number means that you are the first player (small blind), an odd number means that you are the second player (big blind); 0, 1 means you are to decide what to do; 2, 3 means your opponent has folded; 4, 5 means the game has come to a showdown
  • d: when state = 0, 1, it says what you have rolled; when state = 4, 5, it says what your opponent has rolled
  • return value: zero means you want to fold, non-zero means you want to bet (relevant only when state = 0, 1; otherwise ignored)

In addition, you may implement a function called something like InitYourSurname, with prototype void InitYourSurname(). You may use this function to do some precomputation and/or initialize your memory.

We advise you not to use dynamic allocation (which would tremendously slow down your program) and use global variables/arrays instead.

Please, declare all your global variables (and functions other than the two we will call) as static so that their names do not collide with variables/functions of others.

Your implementation should satisfy the following:

  • it uses no more than 64 MB of memory
  • the initialization function runs within 10 minutes
  • the average running time of the AI function is about 1 microsecond

If you have any further questions regarding the rules of the tournament or the specification, please look into the files. If you do not find the answer there, ask in the forum.

There is a soft deadline on 2 December. By this day, you should submit an almost-final solution. We will look at it and tell you that it is OK or that there is some serious problem (it sometimes crashes, uses too much time/memory, ...). Then, you will have about a week to fix/finish it. Thus, the hard deadline will be somewhere in the middle of December. At the last lecture, we will tell you the results of the tournament and a few words about the problem and what our solutions were like.

Následující