[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/bbcode.php on line 112: 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 112: 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 112: 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 112: 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 112: 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 - Ants - bot memory usage

It is currently Sat Dec 14, 2019 6:30 pm Advanced search

Ants - bot memory usage

Share and discuss ideas for your entries here.

Re: Ants - bot memory usage

Postby dimkadimon » Tue Oct 25, 2011 3:49 am

dimkadimon
Major-General
 
Posts: 263
Joined: Wed Oct 06, 2010 11:34 pm
Location: Adelaide, Australia

Re: Ants - bot memory usage

Postby ItWasLuck » Tue Oct 25, 2011 7:20 pm

Plus there are many other optimizations that you can make.

The obvious one is water. You are assuming that you have a 200x200 map of nothing but land.

There are others, but I'm not giving away all my secrets :p
ItWasLuck
Cadet
 
Posts: 7
Joined: Mon Oct 24, 2011 12:28 pm

Re: Ants - bot memory usage

Postby icefox » Wed Oct 26, 2011 6:53 pm

icefox
Cadet
 
Posts: 9
Joined: Wed Oct 26, 2011 6:08 pm

Re: Ants - bot memory usage

Postby infernalmachine » Wed Oct 26, 2011 9:43 pm

Clever idea, icefox.

Unfortunately, I think you may need that 3rd bit though. If you started with full view of the map, then 2 might work, but early in the game you don't actually know if you know a path between 2 points. (This is particularly a problem when you have more than 1 anthill so your visibility "blobs" aren't perhaps connected.) So you need a 3rd bit to mark whether a path has been found/recorded yet. Because you can't just fill in the whole table at game start.

The nice thing you can do with a structure like yours is to milk any path-search you do for all the extra info it contains. Using
A* or wavefront-expansion will produce a lot of information for the squares you visit in your search, even if those squares don't end up on your path.

But I suspect you will still run into time-out problems in trying to fill this table with sufficient info to justify having reserved so much space for it.
infernalmachine
Lieutenant-Colonel
 
Posts: 48
Joined: Fri Oct 21, 2011 2:25 pm
Location: Toronto, Canada

Re: Ants - bot memory usage

Postby icefox » Thu Oct 27, 2011 12:08 am

icefox
Cadet
 
Posts: 9
Joined: Wed Oct 26, 2011 6:08 pm

Re: Ants - bot memory usage

Postby jlgrall » Fri Oct 28, 2011 2:33 am

A few quick and dirty tests with Java on my computer show the following results:

- 1190 ms: time it takes to allocate an array using 1 GB of memory
- 12 ms: time it takes to read all cell of that array
- 550 ms: time it take to write all cell of that array

(My computers: MacBookPro, Intel Core 2 Duo 2.4 GHz, 4 Go DDR2 SDRAM @ 667MHz)

The only fact that I fill 1GB of informations takes me almost 2 turns. I need good time management ...
Fortunately, reading is cheap. Once you have computed all your informations, it gets easy ...
jlgrall
Lieutenant-Colonel
 
Posts: 41
Joined: Sun Oct 23, 2011 11:26 am

Re: Ants - bot memory usage

Postby mleise » Thu Nov 03, 2011 8:55 pm

mleise
Lieutenant-Colonel
 
Posts: 42
Joined: Mon Sep 27, 2010 6:18 pm

Re: Ants - bot memory usage

Postby stickme » Fri Nov 04, 2011 12:30 pm

You could also save paths to farther locations in smaller resolution.
So you could assume that the optimal path to a location that is far away, is the same as to it's adjacent squares.
stickme
Cadet
 
Posts: 1
Joined: Fri Nov 04, 2011 12:22 pm

Re: Ants - bot memory usage

Postby jlgrall » Fri Nov 04, 2011 2:26 pm

Except that in mazes or when there is a long wall between them, two close locations might take a long time to reach from each other.
jlgrall
Lieutenant-Colonel
 
Posts: 41
Joined: Sun Oct 23, 2011 11:26 am

Re: Ants - bot memory usage

Postby pedrosorio » Fri Nov 04, 2011 5:56 pm

pedrosorio
Lieutenant-Colonel
 
Posts: 42
Joined: Sun Oct 30, 2011 4:24 pm

Previous

Return to Strategy

Who is online

Users browsing this forum: No registered users and 2 guests

cron