on actions received by the kernel

From: gorka@gia.usb.ve
Date: Tue 03 Feb 2004 - 03:55:47 GMT


Hi everybody,

I'm trying to debug an implementation of agents based on YabAPI, using a
recommendation I red time ago in the (lost?) mailing list archive.

I'm trying to catch actions submitted to the kernel using the following
modification in the System.cxx kernel source file (v0.43):

    void System::processCommand(Agent* agent, Header header,
            S32 size, Input& input, const LongUDPSocket& /*from*/) {
        agent->inputCommand(header, size, input);
        m_commandToAngents[header].push_back(agent);
        // NEW STATEMENT FOLLOWS:
        fprintf(stderr, "%3ld:%ld: header %ld: %s\n", (long)m_time,
                (long)agent->asObject()->id()), (long)header,
                input.getString().c_str());
        }
    }

When trying this against the YabAPI 'sample' implementation (which uses
inter-agent communication as follows: FireBrigades --> FireStation -->
PoliceOffice --> PoliceForces), I get printed to stderr all actions BUT
the SAY and TELL actions (decimal 132 & 133). They don't appear ever! (I'm
not losing packets, of course, because agents get the communication
actions).

My questions are:

1) How can I trace the SAY/TELL actions received by the kernel?

2) In the previous code, I get an empty string from the
input.getString().c_str() parameter. How can I get the proper string-value
of the action being traced?

Thanks in advance,

---
Gorka G. Llona
AI Group
Universidad Simon Bolivar, Venezuela
http://www.gia.usb.ve



This archive was generated by hypermail 2.1.3 : Tue 03 Feb 2004 - 04:03:16 GMT