- Created Saturday, May 28th 2016 @ 18:34:07
Hi, sometimes I get a timeout.It is not always, most of the time plays whole game.
I'm using Stopwatch.ElapsedMillinseconds.
For the first move I reserve 9900ms and stop my search at 9901. I print the move and flush the output:
Console.Out.WriteLine("place_move " + mCol[vMove] + " " + mRow[vMove]); Console.Out.Flush();
I guess I am missing something. Thanks in advance for any help.
- Created Sunday, May 29th 2016 @ 13:52:13
Why waste all your timebank on the first move? (you get 10000ms for the whole game, and 500ms additional time per move. check getting-started page http://theaigames.com/competitions/ultimate-tic-tac-toe/getting-started)
- Created Sunday, May 29th 2016 @ 14:59:27
The problem is the timeout, it happens in the first move or happen on any move. It is strange that I finish the search early and still times out before printing the selected move. As I said the search ends at 9901, and by the time I print the move it times out. So should I reserve more time to print the move ?
- Created Sunday, May 29th 2016 @ 17:56:42
Timeout can happen at any move once you have exhausted all the time in your timebank. Printing the results should take no time, I don't think it is the problem (which i am not sure i totally understand).
Anyway, you can print some messages from your bot to the Error Stream, and you can check these errors at the dump of your match vs. the test bot..
- Created Sunday, May 29th 2016 @ 19:07:33
Thanks, I think I will change and be more conservative on time control I will leave more time from timebank to complete the play. Initially I was using all time minus 100ms as safety to avoid timeout but it seems it is not enough.. This is my first version and I was using all time including timebank. But of course can be improved.
- Created Monday, May 30th 2016 @ 05:55:20
I'm not sure how garbage collection works in C#, but for for my bot in Java I end up leaving a full second on my clock to avoid timeouts, and even then I occasionally get one near the end of the game.
- Created Monday, May 30th 2016 @ 14:58:39
Good point, GC may play a role in that. I guess it is better to leave more time cushion to avoid timeouts.