Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: simple time management??

Author: Russell Reagan

Date: 10:28:11 06/12/03

Go up one level in this thread


On June 12, 2003 at 08:43:02, Magoo wrote:

>Hi, my engine MiniMardi is doing well!! playing good at a fixed depth = 4.
>Now i've added time management that seems to work (i think), but i wonder how
>other newbie engines do this? My method is: if game has increment,
>allocated_time = inc + time, where time = time_left/speed. Speed is set so that
>if time_left > time_opponent, speed++, else speed--. (to match the opponent).
>This method works well for slow games, but in bullet (1 0) this method doesn't
>work so well, the speed variable takes "moves to update", so this means the
>engine after about move 30, has <10 sec left. To fix this i use a special case
>to detect the game is bullet, but of course, i dont want to this for ALL
>different time controls (3 0, 5 0 etc..).

I think the simplest way to do time management is to always assume that there
are X number of moves left in the game. So if you always assume there are 30
moves left in the game, you will always use 1/30th of the remaining time. If
there is an increment, add that to the time for each move. That way you will
play faster and faster as your time gets lower. There are probably better ways,
but more complicated, and this works fine.

const int moves_left = 30;

int GetTimeForMove () {
    int time = (time_left / moves_left) + increment;
    return time;
}



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.