July 14, 2008

ICFP 2008 After 10 Hours

Posted in Programming tagged , , at 7:22 am by pmatos

The 10 Hours have passed. The result is an unfinished C++ implementation of a rover. In fact, all I did in the 10 hours was the supporting framework for the rover.
Its features are:

  • Connection to server;
  • Parsing of messages from server;
  • Wrapper for sending well-formed messages to server;
  • Messages are converted into world objects that can be added to world state;
  • Launches two threads, one to receive messages from server and another one to control the server based on the current state continuously modified by the first thread;

An hourly update is as follows:

  1. Reading of problem description and implemention of the socket for server connection;
  2. Message Keeping structures;
  3. Decision about initial rover strategy (described later on) and implementation of threads;
  4. Finished handling threads;
  5. Creation of world object structures;
  6. Parsing of messages into object structures;
  7. Finished parsing messages into object structures;
  8. Starting implementation of state-based strategy;
  9. Reverting implementation into a stateless strategy;
  10. Initial implementation of a stateless strategy;

The strategy which initially I thought I had time to implement based on state would require the implementation of a QuadTree structure and some path-finding algorithms also in order to reuse information used in previous turns. As the time was not enough I reverted into a simple stateless strategy where the rover purely reacted to its vision environment:

  • Can I see a Martian? If yes, run like hell AWAY from them.
  • Do I see a Boulder or Crater in path? If yes, then turn to the best side depending on obstacle position.
  • Is homebase in current path? If no, then turn to the best side in order to have homebase in path as soon as possible.

This was ultimately the strategy I decided to follow and still no time was enough. Although sad that I couldn’t dedicate the whole weekend to it I still did a few things and had loads of fun. The implementation was all git-kept and a tarballed for future reference. (if for some reason you cannot access the tarball, let me know).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: