Re: Some questions about YabAPI

From: Philip Stubbings (pmstub@essex.ac.uk)
Date: Tue 31 Aug 2004 - 17:10:59 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

baris.eker wrote:
| Hello everyone,
| I'm trying to develop a system for Robocup Rescue Simulation League
| using YabAPI. I'm not clear at some points and need help.
| 1-As far as I can see, world model of an agent is automatically
| updated by the API. I mean, kernel sends vision info every time
| unit to agents and API integrates this info to its world model,
| and I need to do nothing for that. Am I correct? Also, the world
| model of agents are different, aren't they?

Each agent has a seperate instance of the world model from the YabAPI
which is updated according to individual perceptions of the world. For
example, PoliceForceAgents can retrieve information about other agents
by monitoring the relevant Collections in their DisasterSpace class. If
they can perceive another agent at that particular cycle, it is possible
to retrieve accurate position information etc about the other agent.
Otherwise, if they cannot perceive another agent in that cycle, they can
only retrieve the "last known" particulars of the other agent. You can
test for this with the time() method:

// agent perceives another object in this cycle
if(self().time() == world.get(OTHER_OBJECT_ID).time())

| 2-Which civilians need rescuing? Only buried civilians? Civilians that
| have damage but not buried also need rescuing, don't they? I
| mean with rescuing, both rescuing from buriedness and taking
| civilian to the refuge.

I'm not to sure about this.. If you use the example Civilian agents from
YabAPI, they seem to find their own way back to refuges if they are not
burried by using Dijkstra's algorithm. The R_Civilian agents seem to
have difficulty in finding their own way to refuges (perhaps this is
more realistic). Infact, I have noticed that the R_Civilian agents have
a tendency to jump out of ambulances before an unload command has been
submitted.

| 3-I'm finding civilians by exploring around. While exploring,
| The civilians that are close to me are added to agent's world model as
| far as I can see. However, when I hear from a "help_me" message
| from a civilian I can get its "id" but not its buriedness, if
| it is not "seen" before. However in order to rescue them, I need
| to know their positions. How can I reach to the civilians that
| I can hear but don't know their positions?

You might be able to use the direction and distance methods from
RealObject sender. Get a Collection of buildings that are within the
agents perception, and then examine the building that minimises the
difference in RealObject direction and distance:

// assuming the Civilian is in a building
Building senderBuilding(RealObject sender)
{
~ int dir = self().direction(sender);
~ int dis = self().distance(sender);

~ for(Iterator it = world.buildings.iterator(); it.hasNext();) {
~ Building b = (Building) it.next();
~ if(self().distance(b) == dis && self().direction(b) == dir)
~ return b;
~ }

~ return null;
}

If not, you can use the maximum perception distance of the agent as a
heuristic when searching buildings. (I'm not sure if distance(sender)
will work because agents have can hear further than they can see).

| I will be glad, if somebody can answer these questions.
| Best regards,
| Baris Eker
|

Regards,
Philip Stubbings

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBNLEjxIpidiimOkMRAuj+AKCc2S5PQnjy6TAJWx5owVm8J+AQ8ACfZTSN
XN6D6LzLpfmh2ljXme86Oi0=
=nANW
-----END PGP SIGNATURE-----



This archive was generated by hypermail 2.1.3 : Tue 31 Aug 2004 - 16:16:21 GMT