Timeouts with C++ in CSB (might be more general)


#42

Rising temperatures sound bad. Especially when we’d want their curve to follow a Descent pattern.


#43

My Tron bot is plagued with a very hard-lived timeout error. I have long suspected it is on the server side. It is written in C and based on MCTS. It checks the timer for each tree expansion, and does thousands of such expansions every turn. Most of the time, it works with ~90 ms, but I still get timeouts when reducing down to ~50-70 ms. The current bot (at 82 ms per turn) fluctuated around top 50-60 when I first submitted it, and now is only on 84th place (of course some of this may be due to new competitors too). I checked “latest battles” and found that about a fourth of its losses (final place) are due to timeouts. I have checked all the code over and over, and will do again one day. Maybe I am doing the timing wrong. I am using this:

#include <time.h>
//Millisecond clock:
#define milliclock() ((signed long long)((1000L*(signed long long)clock())/(signed long long)CLOCKS_PER_SEC))

#44

You need to use a high resolution timer. It’s straightforward in C++, but using platform specific code should get you somewhere with C.