Artificial Intelligence Depot
Visiting guest. Why not sign in?
News, knowledge and discussion for the AI enthusiast.
FEATURES COMMUNITY KNOWLEDGE SEARCH  
Swarm Intelligence
This interdisciplinary book places particle swarms within the larger context of intelligent adaptive behavior and evolutionary computation.
More information at Amazon US UK
Challenge for AI Gurus!
A Tron Approach
 
Challenge for AI Gurus!

Hi there!

Assume you have a 2d array with dimensions (n,m) and one or more objects with a position (x,y) and a direction (dx,dy) which is always one of the following: (1,0), (-1,0), (0,1) or (0,-1). The array is initialized with 0 and all objects are alive (object.dead = false).

Now imagine there's a loop that always does the following:



The goal of each object is to stay alive as long as possible. What would be your approach for the object.compute_direction() function?

- flix

PS: sorry, I don't know how to post beautiful code here... =(

1 posts.
Tuesday 09 July, 13:50
Reply
Look Ahead

Hey flix, welcome to the boards.

How about using very simple planning... with only one action look ahead? Basically, pick an action, and if it seems like it'll kill you, pick another.

Now you can get even more complex by adding prediction. You also look an action ahead for each of the other entities within range. You can thereby check if the spot will be occupied next time.

Using this over and over for n actions as a search should provide good results for 2+ depths.

Does that help?

934 posts.
Monday 15 July, 15:21
Reply