Thursday, August 18, 2005

Kshitij @ RoboCup 2005

Am supposed to finish this soon... and i just started. Can write about a lot of things. But also have to make it all relevant, coherent and interesting, and yeah small too. Another major question was, where should i write it. Vim is too drab. Tried openoffice, but it produced the death sentence on my pc (called hanging :P). So i can as well start here. Lets start!!

Multi-Agents is a very interesting field and is particularly useful for simulations and Distributed Intelligence. An Agent is defined as an autonomous entity which senses the environment, analyses its percepts, takes decisions and then acts in that environment. A Multi-Agent System contains many such agents which may cooperate, collaborate or even compete depending on the environment. RoboCup is an international joint venture which promotes research in robotics, AI and multi-agents etc using the two domains called RoboSoccer and RoboRescue (both simulations and involving robots). In RoboSoccer, the team of agents play soccer against another team while in RoboRescue the team of agents need to perform search and rescue operations. The RoboCup competitions are held every year. RoboCup 2005 was held in Osaka, Japan.

The RoboCup Rescue simulation simulates a city which has just suffered an earthquake. Therefore, many buildings would have collapsed, civlians buried under rubble, roads blocked due to the rubble and fires would be raging in many places. This forms the environment for the agents which connect to the server. The agents form the rescue crew who will need to extinguish the fires, clear the roads by removing the blockades and ofcourse rescue the buried civilians. There are three types of agents - Fire Brigade Agents, Ambulance Agents and Police Agents. There also exist three centers i.e Police Station, Fire Station and Ambulance Center which act like communication hubs for the agents. The specified number of each type of agent connect to the server and start acting in the environment. The best way to understand this is to imagine a real city facing the aftermath of an earthquake and the tasks expected of the fire brigades, ambulances and the police of that city. Robocup Rescue is as realistic as that. Each agent can only 'see' or 'hear' upto some limited distance from its position. It has limited speed and can only move on unblocked roads. Hence it wont know where a civilian is buried unless it either hears the cries for help or recieves messages from some other agent conveying the information. The Fire agents can extinguish buildings but they cannot rescue civilians or clear roads. Similarly, ambulances can only unbury and carry civilians to refuges and police can only clear roads. The agents can communicate with each other (like telecommunication in real-life scenario) but the bandwidth is limited and undependable. The job for the teams participating in the Rescue simulation competition is to develop the AI of the agents so that they perform the rescue operations better than other teams. That was precisely my job too. I had to program our Rescue team 'Kshitij' to perform the rescue operations as well as possible.

So, how did the process start? And how did i know about this thing in the first place? Well, I decide to take up honours at the begining of my third year (exactly a year ago :) ) and was interested in AI of the non-linguistics kind. So, the most likely area that was available then in the institute related to Ai other than Ltrc was Multi-Agents of Cde. Found out about Rescue from the official sites, liked it and ended up taking the project. And then did the work go in a planned and effective manner? Nope, not at all. Faced a helluva lot of problems. The 'most major' problem was the lack of documentation of any kind. Rarely was there any way of obtaining some information about the server or the API without actually testing it out by running the simulation. Initially we (then i had two other members also) had some ideas and tried coding the agents from scratch. This went on till dec'04. Being new, i had to find out about every small thing regarding the API by studying the code of the API. A code which had no comments. Most other teams had been participating from 3-4 years and already had a well developed system. However, i finally got the hang of it but then the submission time for the preliminary qualification was dangerously close. And by this time, i was alone in the project. This was when Ravi Jampani came to the rescue (pun intended :P). His immense experience and intelligence helped. Most important was his suggestion to use the basic code of the previous year's winners (a German team). He also wrote the Team Description Paper which was critical for qualification to RoboCup2005. This was in feb'05. We qualified and again I was alone in the project. I was now using the basecode of the previous years winners. Though this meant that i wouldnt have to implement everything, it added the difficulty of understanding their code which was commented in german! Then, it was summer holidays. Now, my whole time was devoted to Rescue. This was also when the server started getting upgraded. The protocols were changed. The fire simulation was greatly modified. The civilian information was made tougher to obtain. Hence, besides implementing the various improvements, i also had to rehaul the whole fire selection mechanism, civilian gathering information etc. Newer versions of the server were being released by them with alacrity. And it was tough keeping up with the pace. Thankful to Yasovardhan who took away the testing burden from me, i managed. And by the end of Jun, we were ready. Then i went to Osaka to participate along with Ravi Sankar and Karteek who were involved with RoboSoccer.

Now, the focus of the story shifts from IIIT, Hyderabad India to Intex, Osaka Japan :D. The RoboCup venue was huge one. Moreover, it was surrounded by the tallest skyscrapers of Osaka. Just imagine :P. RoboCup Rescue consisted of the preliminary round of 3 days (13-15th Jul), semis on 16th and finals on 17th i.e the fifth day. 21 teams qualified for prelims out of which 8 would advance to semis and then four among those would enter the finals.

13th: We had decided to go to the venue a good two hours before the start of the competition. But, we did not have any alarm clock with us! Miraculously, by a quirk of fate, i had my cell with me. So, i set the alarm and we slept peacefully. But it didnt ring. And we reached the venue just in time before the start of the competition! But why didnt it ring? Because - though we were in Japan, my cell still followed IST!! :D. So, I had no time to test my agents on their server. Mine was scheduled as the second team to run. And my agents failed to start!! It was gave some weird errors. So, Kshitij got 0 score in the first map. There were 9 maps in total in the preliminary round. Thankfully, I solved the incompatibility issue before the start of the second map. But i had no time to test on their server. So, time came to run for the second map. The agents connected and started. A sigh of relief. Midway through the run, the fire agents crashed due to paucity of Ram. I hadnt equally distributed the load on both the client computers. I learnt all my lessons by the start of the third round and we ended up 3rd in that map :) (An omen?) We were overall 13th at the end of the day.
14th: Went there on time. Tried to start the agents for the 4th map. But they didnt connect!! I have no idea why. Kshitij again got 0. I became so frustrated. Felt anger towards myself, the server guy, the other teams, robocup organisers, the german team, our institute, everyone!! It was sort of intimidating to find the other teams having like 2-3 laptops and team strengths of some 4-6 while we had one laptop for two teams (rescue and soccer3D). Thankfully, a few teams like that of the chairman of RoboCupRescue Simulation were also represented by a single member. At the end of that round however, they called a meeting of all the team leaders and announced that they had run the server of wrong version for this round, hence this map would be rerun again! Wow, I got a reprieve! The ranking of Kshitij on that day for the three maps were - 6th, 4th, 4th. Yeah, it ran on that fourth map and it ran pretty well. Overall ranking: 7
15th: Now, I was pretty confident. Unless, our agents fail to start, we can easily sail through to the semis. Thats what exactly happened. Rankings for the three maps on that day: 3rd, 3rd, 2nd. Overall ranking: 5. Qualified for Semis.
16th: Semi finals. 5 maps were run on this day. Our ranking in each were: 1, 3, 4, 7, 3. Our fireagents were just vacillating on the 4th map, which explains the bad position. Therefore ranking in the semis: 3. Qualified to the finals!
17th: Finals. Whopping 9 maps were used. But the relative rankings of the four teams remained pretty much constant. Anyway the individual ranking on each map: 3, 3, 3, 3, 3, 1, 3, 2, 3. Overall Ranking: obviously 3.
Hence Kshitij (IIIT India) were Third in RoboCup 2005 Rescue Simulation League. click .
^:)^

8 comments:

Ravi said...

congrats once again ra. You would have saved the trouble of typing had you kept an online diary during those days.

agastyabhrata said...

I'm happy that finally there's an official message sent :)

KoPoS said...

Congrats man :)
Keep the flag flying high!!! :)

Sunil said...

Congrats

Lord of all Things said...

hi interesting blog.. found u .. somewhere.
will keep checking further

kudos,
swati

Vasant said...

hey,

Congratulations !!!

I'm an alumnus of IIIT. Really nice to hear of your effort and the victory. Kudos.

mythalez said...

@ravi - Thanku .. I desperately wanted to write a travelogue sort of thing during those days, but i couldnt due to a serious lack of time.

@sage, u r happy, thats all wat matters :P

@poorna-shashank, Thanku thanku ^:)^ and i ll try my level best :D

mythalez said...

@swati, Welcome to my blog ... found me where somewhere?? :P and yeah do keep checkin :)

@vasant, I know u, atleast i know ur blog :D. Thanku thanku ^:)^