[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - So many timeout

It is currently Mon Jun 18, 2018 10:48 pm Advanced search

So many timeout

Code won't compile? Found a bug? Post here!

So many timeout

Postby Cyrano » Wed Nov 17, 2010 8:57 am

I have some problem with timeout.

I do some tree search based on a timer. The jitter of this search based on log is around few ms. But even with an internal timeout counter of 800ms, i still have timeout in the game. What is the realistic limit to avoid timeout ? 800ms it's still 20% less time than the rules.

Somebody have an idea about the kind of computer the battle are run ? The optimal algorithme are not the same if the cpu is powerfull or not.
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am

Re: So many timeout

Postby Xrillo » Wed Nov 17, 2010 9:52 am

Perhaps this is related to your problem
Xrillo
Captain
 
Posts: 24
Joined: Fri Oct 01, 2010 8:17 am

Re: So many timeout

Postby Cyrano » Wed Nov 17, 2010 8:01 pm

In java, i use System.nanoTime(). I try also currentTimeMillis() but the result are the same.

The very strange think is when mybot play against itself on my host, the timeout occur after 4 cyles event with a 100ms deadline. There is something strange !
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am

Re: So many timeout

Postby Cyrano » Sat Nov 27, 2010 1:23 am

I use both function with a timer at 650ms, but there is still some timeout. It's realy depend on Linux scheduler.

There are far less than 1s of compute time.
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am

Re: So many timeout

Postby Cyrano » Sat Nov 27, 2010 2:07 pm

Even at 500ms, there is some issue.
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am

Re: So many timeout

Postby Cyrano » Sat Nov 27, 2010 5:41 pm

When i look to some match, it seems that the cpu is week or that there is a significant difference in the wall clock time and the cpu time.
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am

Re: So many timeout

Postby iouri_ » Sat Nov 27, 2010 6:04 pm

I've answered a similar question in another thread, though it was for C++ and not Java.

My advice, without going into Java implementation details, is:

- Make sure you're using wall clock and not CPU clock.
- Check the time out frequently. I think on my computer I end up checking it about every 1-2 ms, and even that is still kinda risky. Judging by the sentence "4 cyles event with a 100ms deadline", it sounds like you might be checking it not often enough. I'd check the time often within a single cycle, and stop early if the time's up.
- Make sure minimal processing is done after the bot is out of time, e.g. do minor cleanup and output the moves to stdout.
iouri_
Brigadier-General
 
Posts: 105
Joined: Thu Feb 11, 2010 4:16 pm
Location: Toronto, Canada

Re: So many timeout

Postby Cyrano » Sat Nov 27, 2010 9:32 pm

I use a tree search that stop at timeout. And i use a 500ms timer.

The timer is double using 2 functions : System.currentTimeMillis() System.nanoTime(), the first reaching the limit is used.
Cyrano
Lieutenant
 
Posts: 12
Joined: Wed Nov 17, 2010 8:52 am


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron