Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: choosing target times and probs with clock()

Author: Alex Boby

Date: 13:35:58 06/22/99

Go up one level in this thread


On June 22, 1999 at 16:02:29, Dave Gomboc wrote:

>On June 22, 1999 at 15:18:17, Alex Boby wrote:
>
>>
>>A couple problems with timing...
>>
>>1.   In my limited spare time I've just done the switch over from depth based to
>>time based searching. I am now having difficulties coming up with an algorithm
>>to choose the amount of time which should be spent searching for each move. This
>>is a trivial task if the time controls are x moves in y minutes but if the time
>>controls are simply x minutes for the whole game (like on ICS), then what's the
>>most efficient way to use the time?
>
>Firstly, I find it interesting that you think it's trivial in the first case.
>Do you really want to spend the same amount of time on each candidate?
>
>For a sudden death time control, I guess you have to estimate how long the game
>is going to last, and dynamically update your time usage as the game continues.
>

  I find it trivial because the way I chose to do it is to determine a base time
(y time / x moves) and then adjust for other factors like times remaining on
clocks, in trouble, ect... For sudden death, it's very hard to estimate a base
time because it's difficult to estimate how long the game is going to last. This
is how I'm currently doing it because I could think of no better way but I
thought that there must be one...

>>2.   I am developing in C under linux and using the clock() command for all
>>timings. The problem I have is that when it says that it took, for example, 10
>>seconds to search, it's in actuality more like 25 seconds. At first I thought
>>that I had some kind of problem with casting or arithmetic but I checked all
>>that. I also examined crafty's code and it seems exactly the same as far as
>>usage of clock() is concerned. Then I thought that maybe my clock chip was
>>malfunctioning, but if this were the case then my system would not be keeping
>>accurate time,... but it is. Therefore I have no idea what the problem could be,
>>but it's a pretty significant one as far as I'm concerned. Any ideas?
>
>You can ask the OS about wall-clock time or about process CPU time... lots of
>variations.  Advanced Programming in the UNIX Environment is a good book to look
>up details on this stuff.

    Thanks,.. I'll check that out.


>
>>Much thanks,
>>Alex Boby
>
>Dave



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.