[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 - [Java] Food blocks after eaten in Ants.java

It is currently Mon Jul 16, 2018 10:30 pm Advanced search

[Java] Food blocks after eaten in Ants.java

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

[Java] Food blocks after eaten in Ants.java

Postby swinejihad » Sat Oct 22, 2011 1:06 am

I'm working through the beginner tutorial, specifically step one, and I've come across a problem with the ants eating food. When the ant comes near the piece of food (right above the ant hill) it eats it normally (animation, food disappears) and a new ant is spawned at the ant hill but afterwards it moves around it as if it were still there and blocking it from moving there. Using the Ants.java getIlk() I can see that the tile's state in the java Ants is still Food, but looking at the input to my bot there is no food input at that location after it has been eaten.

I'm using the most modern version of python 3.2 and have not received any error messages. I have copied and pasted the code from the website to ensure that it's not one of my mistakes. The following are some pictures to explain what I mean. The bot is using the default "try north else east else south else west" movement algorithm from the java starter package.
swinejihad
Cadet
 
Posts: 2
Joined: Sat Oct 22, 2011 12:39 am

Re: [Java] Food blocks after eaten in Ants.java

Postby swinejihad » Sat Oct 22, 2011 1:39 am

Updating, I've managed to solve the problem by editing the starter package to manually clear any food tiles at the beginning of every turn.
swinejihad
Cadet
 
Posts: 2
Joined: Sat Oct 22, 2011 12:39 am

Re: [Java] Food blocks after eaten in Ants.java

Postby ratvier » Sat Oct 22, 2011 8:32 am

Also there same problem with dead ants... Please review my fix
ratvier
Cadet
 
Posts: 7
Joined: Thu Oct 20, 2011 1:40 pm

Re: [Java] Food blocks after eaten in Ants.java

Postby jivimberg » Sun Oct 23, 2011 11:03 pm

Thanks for the solution, I was having the same problem over here.
Btw even after fixing this food blocks issue I don't get the same result in my game than the one of the step 2 of the tutorial. I believe it is because of the order in which my ants choose their next movement. Any idea? Did you get the same result?
jivimberg
Cadet
 
Posts: 2
Joined: Sun Oct 23, 2011 10:58 pm

Re: [Java] Food blocks after eaten in Ants.java

Postby McLeopold » Wed Oct 26, 2011 5:34 pm

While writing the java tutorial, I noticed the food wasn't being cleared properly. It should be fixed now. Also, sir-macelon has done a lot of cleanup on the code as well.

The java bot has different sorting than the python bot. In python, a tuple is used that sorts on every element, dist, from.row, from.col, to.row, to.col. I didn't bother putting in all the needed code to get the java bot to sort the exact same way. The biggest difference is that the python bot explores from left to right first, and the java bot explores from top to bottom. Plus, the java bot gets stuck at the end and doesn't take out the hill. I was using some tricks in python, like making the unblock hills code go south first, to make the tutorial games look nice.

Don't worry about getting the exact same results.
McLeopold
Contest Organizer
 
Posts: 262
Joined: Sun Sep 19, 2010 3:31 am

Re: [Java] Food blocks after eaten in Ants.java

Postby Relio » Fri Nov 18, 2011 1:23 am

I am having the same problem with the C++ package. Food that should have been eaten was left and then blocked my movement for one frame before allowing movement. This is messing me up because I'm expecting a move to occur and it isn't.
Relio
Cadet
 
Posts: 1
Joined: Fri Nov 18, 2011 1:21 am


Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 2 guests

cron