Author: Dann Corbit
Date: 11:49:33 01/08/03
Go up one level in this thread
On January 08, 2003 at 13:08:07, Normand M. Blais wrote:
>Hi,
>
>My program does not handle time mangament very well. I've tried different
>implementations but I'm not satisfy with any so far. I believe that the reason I
>haven't succeeded in solving the problem is that I don't fully understand it.
>First, I would like to know if most program ignore the time information sent by
>the GUI (Winboard or Arena) and use its own clock checking routine. Next, how do
>you determine that a position (at the root) can be handle rather quickly while
>another one requires more "thinking time". I would appreciate if one can answer
>my questions with specific examples.
A simple idea is to use 1/n of the time left at each move for G/<time> games.
For instance, for G/60, you might use 1/35 of the time for the whole game on the
first move. Then use 1/35 of the time left for the next move and so on. That
way, you will never lose on time.
If you have an increment, you can just add that to the time slot.
Then comes the question of what to do on a fail low. If you fail low on
something and go down a whole pawn or more, you may as well spend as much time
as you need to resolve the fail low. You are probably going to lose if you
don't come up with something better. If you fail high and you are running out
of time, just move the fail high move.
Here is Pepito's time managment routine:
//------------------------------------------------------------------------------
entero32 AllocTime(int mv_ctrl, int numjug, entero32 time_left, int inc)
{
entero32 allocated;
if (inc) {
return (entero32) (inc * (time_left / ((float) time_left + inc)) +
time_left / 35.0f + 0.5f);
} else if (mv_ctrl) {
allocated = (time_left / (mv_ctrl - ((numjug / 2) % mv_ctrl)) * 80 /
100);
if (time_left < 1000)
allocated = allocated * 80 / 100;
} else
allocated = time_left / 40;
CONTROL_INC = allocated > 300 ? 50000 : 20000;
Log("mv_ctrl: %d, time_left: %d, allocated: %d\n", mv_ctrl, time_left,
allocated);
return allocated;
}
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.