It is currently Fri Jan 15, 2021 3:07 pm Advanced search

How much is one second?

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

How much is one second?

Postby jjmerelo » Mon Feb 07, 2011 11:41 am

I know it's entirely too late, but since we're trying to do some work on evolving bots for this game, I might as well ask this question.
The problem is that when you try to simulate a combat in a machine other than the contest machine, you don't really know what's the number-of-instructions executed equivalent to the one in the contest. It's a principle problem, anyways: how do you know your bot has timed out unless you submit it to the contest machine (and it will be too late when you do that)?


Posts: 3
Joined: Mon Feb 07, 2011 11:36 am

Re: How much is one second?

Postby jbroman » Mon Feb 07, 2011 2:12 pm

One way would be to watch how much clock time has passed and make a last-minute decision if your time is about to run out. Options for this include checking the time periodically, or using either setitimer or alarm to interrupt your program after some amount of time.

The rough power of the contest machines isn't secret, so you could estimate based on that. And of course you even submit your bot and do some trial-and-error to determine how much work you can do without timing out.

Or you could also just make your algorithm so super-fast that you don't even need one second. ;)
Jeremy Roman
Student, Computer Science
University of Waterloo
Posts: 8
Joined: Mon Feb 01, 2010 5:39 pm

Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 4 guests