It is currently Tue Jun 19, 2018 4:13 pm Advanced search

Orders not issued

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Orders not issued

Postby Yexo » Wed Nov 16, 2011 10:44 pm

I'm having a very strange problem. Sometimes the orders my bot orders seem not to be taken into account. See for example the following game:

Game: http://ants.fluxid.pl/replay.1627
Bot name: GotAnts
Input/output turn 152/153: http://paste.aichallenge.org/CoKNs/raw/

During turn 153 GotAnts is logged as having a timeout. The reason for this timeout is an assert in my code. This assert tries to make sure all orders were executed. As you can see in the above output, it did output "o 65 77 N" in turn 152. Since there is nothing blocking that move, the bot expected that move to be carried out. Upon receiving "a 65 77 0" in turn 153 it crashed.

Are there reasons for the above order not to be carried out?
Yexo
Cadet
 
Posts: 4
Joined: Wed Nov 16, 2011 10:05 pm

Re: Orders not issued

Postby Scryer » Wed Nov 16, 2011 11:14 pm

I suspect a food spawned at the place your ant was headed for, blocking its progress, and that if you hadn't done the "assert" it would have shown the food where you expected your ant to be. Do your asserts go to stdout? I would turn them off when competing to save time, but if you have them turned on they should go to stderr instead.

[My mistake - replaying the game, I see there was no food blockage, but it shows you timing out. Could it simply be a timeout that stopped you?]
Scryer
Colonel
 
Posts: 72
Joined: Wed Nov 09, 2011 5:40 pm

Re: Orders not issued

Postby Yexo » Wed Nov 16, 2011 11:20 pm

Food spawning is supposed to be after moving, so that should not be a reason to block the move. In this particular case I'm certain there was no food spawn, as you can see from the replay.

An assert stops the running of the program completely, hence it doesn't matter if it goes to stdout or stderr.

Edit: it shows timeout, but that's because its a tcp server and as such the bot is running on my own computer. When it hits the assert it pops up a window and ask me what I want to do with it. For the server it looks like I simply stop sending moves and it records it as a timeout.
Yexo
Cadet
 
Posts: 4
Joined: Wed Nov 16, 2011 10:05 pm

Re: Orders not issued

Postby Yexo » Fri Nov 18, 2011 4:41 pm

Turns out there was a bug in the tcp server which caused it to lose lines every once in a while due to code that was not thread-safe. It's all fixed now and (hopefully) working correct :D
Yexo
Cadet
 
Posts: 4
Joined: Wed Nov 16, 2011 10:05 pm


Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 3 guests

cron