[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/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 - Ignoring path finding and using collaborative diffusion

It is currently Sat Oct 20, 2018 3:14 am Advanced search

Ignoring path finding and using collaborative diffusion

Share and discuss ideas for your entries here.

Re: Ignoring path finding and using collaborative diffusion

Postby heartcore1970 » Mon Nov 14, 2011 9:18 pm

Very informative thread!
This challenge is so much more a learning experience (steep curve!) for me, as it is a challenge. Thus far I have been challenging primarily myself.

I have just implemented collaborative diffusion using your blog post and the related PDF article. Took me more than an hour but low and behold: my ants are getting food all over the map!

Amazing how much fun this is!
Thanks
heartcore1970
Cadet
 
Posts: 6
Joined: Sun Nov 13, 2011 7:11 pm

Re: Ignoring path finding and using collaborative diffusion

Postby athkalia » Tue Nov 15, 2011 1:12 am

thnx for all the advice.. I managed to do it after like a week of programming lol!
athkalia
Cadet
 
Posts: 8
Joined: Thu Sep 30, 2010 12:25 am

Re: Ignoring path finding and using collaborative diffusion

Postby zanirzrold » Wed Nov 16, 2011 3:42 am

Anyone who is doing this figured out how to do mazes using collaborative diffusion? On random walks I have beautiful flock-like behavior, but on mazes I get entirely stuck because my explore diffusion gets broken. Do I need to also introduce pathfinding/lampposts to get out of here?
zanirzrold
Lieutenant
 
Posts: 11
Joined: Sun Nov 06, 2011 9:07 pm

Re: Ignoring path finding and using collaborative diffusion

Postby mac » Wed Nov 16, 2011 7:42 am

mac
Brigadier-General
 
Posts: 151
Joined: Mon Oct 31, 2011 6:39 am

Re: Ignoring path finding and using collaborative diffusion

Postby zanirzrold » Wed Nov 16, 2011 7:42 pm

zanirzrold
Lieutenant
 
Posts: 11
Joined: Sun Nov 06, 2011 9:07 pm

Re: Ignoring path finding and using collaborative diffusion

Postby bluegaspode » Wed Nov 16, 2011 8:41 pm

you should not diffuse into water.
the diffusion formula should only take those neighbors into consideration, that have a diffusion value (which water has not)

then you get a proper diffusion 'floating around' the water
bluegaspode
Colonel
 
Posts: 51
Joined: Mon Nov 07, 2011 8:38 am

Re: Ignoring path finding and using collaborative diffusion

Postby infernalmachine » Wed Nov 16, 2011 9:13 pm

I've had the same problem with the water squares. After reading your post I went and changed my code (thanks!) so that water is not relevant. There's 2 ways to do this that I can think of, neither of which should be all that expensive in comp. time.

1. Count the neighbors who aren't water, and divide by this number instead of 4 -- note here you can still add the 0 value for water to the sum -- it just won't count for anything -- or you can skip the addition of 0. This way is probably simplest if you are using a diffusion coefficient (D) of 0.25 (ie just averaging the neighbors).

2. In my case, I was using a different D, and had split the diffusion formula into parts so I could pre-calculate half of it. So changing the divisor would mess up my earlier calculations. What I did instead was to set the value of a water square to the same as the central square in the diffusion process (but still set it to 0 on the map).

So when looking at the 4 neighbors, if a neighbor square is water, add central square's value to neighbor total instead of 0, and then still divide by 4 to calculate new central square value. This cancels out the water square's contribution, but leaves non-water squares contributing 1/4 as before.

It definitely made an improvement to the wiggling ant problem.

The only concern is that now the diffusion map keeps getting hotter and hotter (because the water squares are no longer functioning as a sink), and at some point that means that information is lost, because the number of steps between high and low gets smaller over time. But I suppose I could just divide all values on map by 2 every so many turns if it becomes a problem.
infernalmachine
Lieutenant-Colonel
 
Posts: 48
Joined: Fri Oct 21, 2011 2:25 pm
Location: Toronto, Canada

Re: Ignoring path finding and using collaborative diffusion

Postby mac » Thu Nov 17, 2011 12:23 am

mac
Brigadier-General
 
Posts: 151
Joined: Mon Oct 31, 2011 6:39 am

Re: Ignoring path finding and using collaborative diffusion

Postby stupidquestions » Wed Nov 23, 2011 11:20 am

This is a pretty basic question, but: How do you guys solve ant collision problems?
stupidquestions
Captain
 
Posts: 23
Joined: Wed Nov 16, 2011 1:02 pm

Re: Ignoring path finding and using collaborative diffusion

Postby mac » Wed Nov 23, 2011 12:24 pm

mac
Brigadier-General
 
Posts: 151
Joined: Mon Oct 31, 2011 6:39 am

PreviousNext

Return to Strategy

Who is online

Users browsing this forum: No registered users and 5 guests

cron