<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Call Graph Profiling for Multi Agent Systems</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Dinh Doan Van Bien, David Lillis and Rem W. Collier School of Computer Science and Informatics University College Dublin</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>-The design, implementation and testing of Multi Agent Systems is typically a very complex task. While a number of specialist agent programming languages and toolkits have been created to aid in the development of such systems, the provision of associated development tools still lags behind those available for other programming paradigms. This includes tools such as debuggers and profilers to help analyse system behaviour, performance and efficiency. AgentSpotter is a profiling tool designed specifically to operate on the concepts of agent-oriented programming. This paper extends previous work on AgentSpotter by discussing its Call Graph View, which presents system performance information, with reference to the communication between the agents in the system. This is aimed at aiding developers in examining the effect that agent communication has on the processing requirements of the system.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        By its nature, a Multi Agent System (MAS) is a complex
system consisting of loosely-coupled autonomous software
entities that are required to communicate with one another in
order to achieve individual or system objectives. To facilitate
the development of such systems, a number of agent-oriented
programming languages and MAS toolkits have been developed
by a variety of researchers [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. However, the availability of
ancillary tools to aid with debugging and profiling is limited,
particularly when compared with the available tools for other
programming paradigms and languages.
      </p>
      <p>
        Previous work introduced AgentSpotter, a profiling tool
designed specifically for MASs [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Profiling is a performance
analysis technique that is based on the notion that in a program,
only a few places, called bottlenecks or hot spots, can account
for the majority of the execution time of a program. Hence,
by fixing only these sections of the code, the performance
of a program can be substantially improved. Profiling was
introduced almost 40 years ago by Donald E. Knuth in his
empirical study of FORTRAN programs [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and has since
been successfully adapted to a variety of different languages,
platforms and software architectures, including large distributed
systems.
      </p>
      <p>The aim of this paper is to continue the mapping of traditional
concepts to those of agent oriented software engineering so as
to facilitate the compilation of useful profiling data, presented in
an intuitive, visual fashion in order to aid multi agent developers
in improving the performance of their systems.</p>
      <p>Section II provides a brief discussion of some related tools
that have been developed for debugging and profiling MASs.</p>
      <p>In Section III, we give a brief overview of the AgentSpotter
agent profiling application. Following this, in Section IV we
introduce the concept of a call graph, and analyse how the
traditional concept of a call graph can be applied to a MAS.</p>
      <p>Section V presents the concrete implementation of an agent
call graph within AgentSpotter profiling tool, followed by a
discussion of the proposed approach in Section VII. Finally,
we conclude and outline ideas for future work in Section VIII.</p>
      <p>The work presented in this paper draws from two principal
research areas. Firstly, in order to provide a profiling tool for
MASs, it is necessary to examine the concepts and features
of existing profiling tools for other programming paradigms,
such as object-oriented programming. It is also necessary to
explore the available programming tools aimed at aiding the
debugging and profiling of MASs.</p>
      <p>
        Initially proposed by Knuth, the key motivating factor behind
profiling tools is his observation that “less than 4% of a program
accounts for more than half of its running time” [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. By
identifying and improving code that represents a performance
bottleneck, software developers can greatly improve the overall
performance of their programs. An important motivator for
the use of specialist profilers to identify these bottlenecks
is the frequent tendency of developers’ mental map of their
programming not matching the reality of how the program
behaves. Thus, areas of concern that programmers may not
have considered will be identified by the profiler.
      </p>
      <p>
        In the context of more traditional, non-MAS, programming,
developers generally have access to long-established and
widely-accepted profiling tools such as gprof [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] or performance
analysis APIs such as the Java Virtual Machine Tool Interface
(JVMTI) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] or ATOM [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. However, those developing MASs
do not tend to have access to such well-established tools.
      </p>
      <p>
        One MAS framework that does provide the ability to glean
data about system performance is Cougaar [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This provides
access to data on historical performance data, event detection,
monitoring of ACL messages and a number of other services.
      </p>
      <p>
        The LS/TS agent platform provides an administrator tool that
records some high-level system monitoring information [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The
main limitation of these systems is the lack of post-processing
of the raw performance data in order to produce meaningful
synthetic indicators like a profiler would do.
      </p>
      <p>
        Besides performance analysis, most agent frameworks
provide a debugging tool similar to the Agent Factory
Debugger [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], which provides information about the mental state
and communication from the viewpoint of individual agents.
      </p>
      <p>
        A different type of debugging tool is the Agent Viewer that
is provided in the Brahms toolkit [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], which displays agent the development and deployment of agent-oriented applications.
timelines so as to understand when agents’ actions are taken. A more detailed description of this implementation and the
      </p>
      <p>
        As the work in this paper also requires the monitoring of data gathered by AgentSpotter can be found in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
inter-agent communication (see Section IV), it is also important Previously, it was shown how AgentSpotter was used to
to acknowledge the availability of existing communication- map traditional profiling concepts onto agent-oriented concepts.
analyis tools for MAS platforms. A number of such tools have This focused on two types of visualisation:
been developed for a variety of agent frameworks and toolkits Flat Profile: provides data on such things as agent activity,
to aid developers in understanding the interaction between messages and reasoning/action duration in a tabular form.
agents in their systems. An early example of such a toolkit is Space-Time Diagram: provides a navigable visualisation
Zeus [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], which contains a “society tool” that visualises the representing the data from the flat profile in a more
interaction between agents, so as to help in understanding the intuitive manner.
topology of the social contacts within the MAS. This type of The focus of this paper is on an agent-oriented call graph.
tool also aids in debugging MASs, since developers can ensure Whereas a space-time diagram can aid in identifying the timing
that the expected communication and collaboration between and extent of actions executed by agents, a call-graph is
agents is indeed taking place. traditionally intended to also indicate the reasons why particular
      </p>
      <p>
        In the JADE agent development framework, a Sniffer Agent actions were undertaken at particular times.
is a FIPA-compliant agent that monitors messages created with
an Agent Communication Language (ACL) passed between IV. CALL GRAPH CONCEPT
Aagemnotsreansodpphrisetsiecnattsedthteosoel,icnaallesdimApCleLAgnraaplyhsiecra,l pinrotevrifdaecsem[1o2re]. A. Traditional Call Graph
detailed information on agent communication [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. Again, the
principal aim of this is to aid in debugging errors in MASs
that relate to coordination or cooperation.
      </p>
    </sec>
    <sec id="sec-2">
      <title>III. AGENTSPOTTER</title>
      <p>
        AgentSpotter is a profiling tool designed specifically for
gathering and displaying profiling information on MASs [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
Figure 1 illustrates the abstract architecture of the system,
designed to be compatible with any type of agent platform. The
AgentSpotter Service runs within the Run-Time Environment of
an Agent Platform, gathering data about the agents themselves
(actions performed, messages exchanged), along with system
data such as CPU and memory usage. This is the only portion
of the system that must be ported in order to be run on different
agent platforms. The data gathered is logged into a Snapshot
File, which allows it to be accessed and analysed offline, once
the system has finished running.
      </p>
      <p>AgentSpotter Station is a visual application that provides a
number of visualisations on various aspects of system
performance, in order to help programmers to identify performance
bottlenecks in their code.</p>
      <p>AGENTPLATFORM
ProledApplication
messages Run-TimeEnvironment
activity
events
AGENTSPOTTERSTATION(visualisationapplication)</p>
      <p>SessionSummaryTables
Space-TimeDiagram
Cal GraphTreeView
queries</p>
      <p>QUERYENGINE</p>
      <p>Sessionsummaryquery
Agentactivityquery
Messagessent/receivedquery
Cal graphquery
Systemactivityquery
events</p>
      <p>AgentSpotterService</p>
      <p>Proler</p>
      <p>SystemMonitors
data Sessions</p>
      <p>Agents
data
SnapshotFile(.aspot)</p>
      <p>Events
Messages</p>
      <p>
        The outputs utilised in this paper are gleaned from running a
concrete implementation of the AgentSpotter service within the
Agent Factory framework [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. Agent Factory is a modular and
extensible framework that provides comprehensive support for
The concept of a call graph was introduced in 1982 in the
“gprof” profiling tool [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. This is an improvement on the popular
“prof” UNIX profiling tool. In additional to summarising the
time spent in different functions, it also recursively presents
all the call stacks annotated with the time spent in the various
functions that are called. Another name for the call graph
is “hierarchical profile”, which conveys the idea that gprof
provides information to aid in understanding the impact of one
function in relation to all the functions that have called it.
      </p>
      <p>Although the textual output of gprof is very dense and
requires some practice to understand, modern profiler user
interfaces have made call graphs more tractable by presenting
them as tree view controls that can be interactively explored.</p>
      <p>Figure 2 shows an example of a typical call graph. This
relates to a fictional C language program that is designed to
remove duplicate lines from a text file. In this tree view, the
root node is the main function, which represents 100% of the
total execution time of the program (including the execution
time of its child nodes). Each node represents a function within
of M on agent B. Note that the outgoing message at time
stamp does not break the computation sequence.</p>
      <p>It is now easy to determine the total impact Tx;y of all
the messages sent by a given agent x to another agent y. Let
M be the total number of messages sent, 1 m M a
single message impact identifier, m the reception time stamp
of message m from x to y, and m, where m m, the
next reception time stamp message coming right after m from
any other source. The total impact Tx;y is then given by the
equation:
the program, with the child nodes representing functions that
are called within the parent function. The percentages represent
the cumulative proportion of the program’s execution time that
is attributable to a node and its children. In the example, the
main function calls process file, which is then represented
as a sub-tree with leaves representing its own calls to the
bubble sort, load file and remove duplicates functions.</p>
      <p>The key benefit of the call graph tree view is the extended
context it gives to performance information. For instance, this
simple example reveals that the program spends 90% of its
time processing a file. The tree shows that one of the
toplevel function process file’s callees, the bubble sort operation,
accounts for 80% of its caller time. A flat profile would have
shown the time for these functions separately without explicitly
showing the hierarchical link between them.</p>
      <sec id="sec-2-1">
        <title>B. Agent-Oriented Call Graph Model</title>
        <p>
          When constructing a flat profile for a MAS, it was necessary
to map a number of concepts relating to traditional
programming to equivalent concepts in the domain of agent-oriented
programming [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. A similar mapping must be performed in
order to allow for the development of an agent-oriented call
graph.
        </p>
        <p>The central measure used in the traditional call graph is
the function execution time. Each node represents a function,
which can take the action of calling other functions as part
of its execution. The consequence of this action is that some
amount of time is spent executing the child function. Thus
we can say that the impact of calling a function is that this
additional processing time has been incurred.</p>
        <p>In many MASs, agents tend to perform actions as a reaction
to the receipt of ACL messages from other agents in the system.</p>
        <p>Thus in the same way the impact of a functional call in a
traditional system is the execution time of that function, within
a MAS, the impact of a message can be related to the additional
processing that must be undertaken in order to react to the
information contained therein, formulate a response or perform
a requested task. Because of this mapping, we introduce, as a
first simplified approach, the agent message impact measure to
be used as an equivalent to the function processing time used
in traditional profiling.</p>
        <p>The quantification of such a measure is a difficult task,
given the data typically available from MASs. One potential
measurement for TM ;B, the impact of a message M sent
from an agent A to an agent B and received at time stamp</p>
        <p>is to use the total amount of computation time used by the
agent B until agent B receives a message M from another
agent X at time stamp . Let b be the duration of an
activity by agent B at time stamp t where t . The
impact of message M on agent B, TM ;B, is then given by
the recurrent equation:
(2)
(3)
(4)
(5)</p>
        <p>By applying the equations recursively, we can compute the
total impact Tx of an agent x on N other agents numbered
1 a N as follows:
1</p>
        <p>Finally, the total impact TS of all the K agents numbered
k K of a session S is given by the equation:</p>
        <p>M m
Tx;y = X X bt</p>
        <p>m=1 t= m</p>
        <p>N Ma m
Tx = X X X bt
a=1 m=1 t= m</p>
        <p>K Nk Ma m
TS = X X X X bt
k=1 a=1 m=1 t= m</p>
        <p>K k0 1
AS = TS + X X bt</p>
        <p>k=1 t= S</p>
        <p>It must be noted that the total activity time AS of the session
S is given by the equation:
where S is the first recorded time stamp in session S and
k0 the time stamp of the very first message received by agent
k. To put it differently, the total impact for each agent can be
TM ;B = X bt (1) computed only after it has received its first message.</p>
        <p>t= This proposed method of calculating agent message impact</p>
        <p>In Figure 3 we have tried to summarise this concept in is imperfect, and superior metrics are likely to be developed
a graphical form. The diagram clearly shows that the three in the future. However, it does provide useful information for
activity stars that lie between and make up the total impact the debugging and development of MASs. Both the drawbacks
and benefits of this approach are outlined in more detail in
Section VII.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>V. CALL GRAPH VISUALISATION SPECIFICATION</title>
      <p>The conceptual model we have presented deals with the
session level, the emitter agent level, the receiver agent
level and the message level. The graphical translation of
the model, outlined In Figure 4, should be a tree view
representing the levels we have previously enumerated plus an
additional level for the FIPA ACL message content. A message
content is defined as a performative plus an expression e.g.
“request:doSomeThing(123)”. This additional level should give
developers necessary contextual information for the messages.
It is important to note that this fixed-depth call graph tree
represents a divergence from traditional call graphs, whose
depth is dictated by the depth of the deepest function call stack.
Fig. 4. Call Graph Tree View levels</p>
      <p>The session at the root of the tree should add up to 100%
of all emitter agents’ impact as defined by Equation 4. Then at
each level, each node should recursively total the impact of its
child nodes down to the message leaf nodes. These leaf nodes
simply report their impact as defined by Equation 1. More
precisely, at each level, for each node, the following values
should be displayed:</p>
      <p>Label: informative text associated with the node. The
structure of the label depends on the level as follows:
– session: “capture date, time - duration”;
– emitter agent: “from: agent id”;
– sender agent: “to: agent id”;
– FIPA ACL: “performative: contents”;
– message: “sent: time stamp rec: time stamp”.</p>
      <p>Total impact time: sum of impact times of all the current
node’s children.
% parent time: percentage of the current node total
impact time divided by the node’s parent total impact
time.
% session time: percentage of the current node total
impact time divided by the session total impact time.</p>
      <p>Ideally, developers should be able to order the intermediary
tree levels differently so as to produce different call graph
interpretations. For example, moving the FIPA level right above
the emitter agent level would list for each FIPA ACL entry
their total impact for all the emitter/receiver pairs.</p>
      <sec id="sec-3-1">
        <title>A. User Interface</title>
        <p>Despite having a fixed depth, a call graph tree view could
potentially be very wide at the leaf level for sessions that
produce thousands of messages. Therefore, to help developers
navigate easily through the tree, AgentSpotter Station offers
an advanced tree navigation user interface that expands only
that part of the tree which is currently explored so as to reduce
the visual clutter. The currently explored part of the tree is
highlighted in a different colour to give the developer some
visual feedback.</p>
        <p>Moreover, to speed up the retrieval of information on the
system, a search feature allows developers to enter a keyword
(e.g. an agent name or a performative). Doing so has the
effect of highlighting in a special colour all the visible nodes
that contain the specified keyword, significantly improving the
visual retrieval speed of a node.</p>
        <p>Finally, developers can zoom and pan around the tree view
to locate items even more quickly.</p>
      </sec>
      <sec id="sec-3-2">
        <title>B. Implementation</title>
        <p>A sample screen shot of the visualisation of the call graph
can be seen in Figure 5.</p>
        <p>In this figure, the element numbered 1 on the screen shot is
the tree root, i.e. the session level which represents 100% of the
cumulative recorded activity time. The tree root is highlighted
in blue because it is the current tree selection in this specific
example. As such, it determines the branch that is expanded,
as stated in Section V-A, so as to reduce the visual clutter. In
order to provide a sufficient level of detail, all the children
and grandchildren of a selected node are visible. Consequently,
when the tree root is selected, only the first two subsequent
levels are expanded, that is the emitter agent level and the
receiver agent level. Hence, selecting an emitter agent node
should make the FIPA ACL message level visible, and so on.
As an illustration, the call graph numbered 3 shown in Figure 5
screen shot, has an agent receiver node selected; as a result,
this branch is fully expanded down to the message impact
level.</p>
        <p>The element numbered 2 is a text area used to enter a
search keyword. The number of nodes matching the keyword
is displayed and all the matching nodes that are visible are
highlighted in pink. For instance, the element numbered 3 is
one of the nine nodes containing the “explorer” keyword and so
is highlighted in the screenshot. In a large expanded tree, this
highlighting greatly adds to the visual effect and consequently
to the navigability of the tree. The bottom-most highlighted
node in the tree represents a message sent from the “botagent3”
agent to the agent named “explorer”. Clicking on this node
would cause the subtree rooted at that node to be expanded so
as to examine the content and timing of that message.</p>
        <p>The visualisation is completely interactive and can be
controlled using the mouse or the keyboard. Possible interactions
include panning, scrolling, expand tree branches, zooming in
and out.</p>
        <p>One other important feature is the ability to alter the
hierarchy of the nodes. Whereas the recursive nature of function
calls means that these are inherently inflexible in the tree
hierarchy they create, the nature of message-passing is a
different situation. The hierarchy above places the sender of
each message in a higher position in the hierarchy than the
recipient. This means that the cumulative performance data
for the higher-level nodes represents the overall impact of all
messages sent by a particular agent to other agents. However,
this may not encapsulate the information that a developer
requires at a particular point in time. Changing the hierarchy
to place the recipient agent above the sender changes the
focus of the cumulative performance data. In this case, the
figures represent the contribution to overall running time of a
particular agent, based on the message that it receives from any
and all sources. This may potentially identify entire individual
agents as bottlenecks. This may be because the system’s load
is imbalanced, meaning that one agent may bear an inequitable
share of the processing burden. Alternatively, in a distributed
MAS, an agent may simply reside on a machine with inferior
hardware resources. By exploiting the flexible nature of this
hierarchy, users of the call graph tree view can alter the data
being presented to better fit their needs.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>VI. EVALUATION</title>
      <p>
        To demonstrate the effectiveness of the call graph as a
profiling tool, a simple benchmark application was developed.
This consists of two types of agents. Overseer agents request
worker agents to perform small, medium or large tasks. If
a worker agent has recently been overloaded, it may refuse
to execute the required task. Occasionally, overseer agents
will delegate the assignment of tasks to a worker agent, in
which case the worker agent becomes an overseer agent for
a brief period. A flat profile and space-time diagram for this
benchmark system is contained in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Figure 6 shows a portion
of the call graph tree view for a run of this application. Here,
the names of overseer agents begin with “master”, whereas the
names of worker agents begin with “agent”.
      </p>
      <p>The benchmark application profile (displayed in Figure 6
reveals that overseer agents master1 and master2 do not have
the same impact on performance. Intuitively, one would expect
each overseer agent to have an equal impact. However, in
reality, we can see that the impact of messages sent by the
“master2” agent accounts for only 20.4% of the overall session
running time. Studying the call graph in more details helps
in explaining this imbalance, by studying the effects of the
messages with the content “pleaseDoThing(20)” that were sent
by both master1 and master2 to agent001. These are emphasised
in Figure 6 by means of the red rectangles. In each case, the
parameter passed as part of the a “pleaseDoThing” request is
related to the amount of work that the agent is being requested
to perform.</p>
      <p>The call graph shows that some requests from master2 have
a 0.0 impact which in practice means they were ignored (no
actions took place as a result of receiving those messages). In
other words, when master1 sends a request to an agent, and
immediately afterwards that master2 sends the same request to
the agent, the overloaded agent simply refuses to execute the
request. These “pleaseDoThing(20)” messages sent by master1
are reasonably consistent in terms of their impact, are never
refused and account for a total of 8.8% of the total session
running time. In contrast, only a single such request sent by
master2 was honoured by agent001. This action accounted for
a mere 0.5% of the session running time.</p>
      <p>It is important to note that the greater impact of master1’s
messages does not necessarily constitute a bottleneck, merely an
imbalance in the system. This type of analysis would motivate
the use of the space-time diagram to examine the timing of the
messages in question, so as to further find why messages from
master2 are more likely to be ignored by the worker agent.</p>
      <p>A bottleneck would be identified by comparing the impact
of different messages being sent (rather than the same message
being sent by different agents). For instance, it is notable
that the session impact percentages for “pleaseDoThing(1)”
messages sent by master1 to agent001 are far lower than for
“pleaseDoThing(20)”. In this simple benchmark application,
this is an unsurprising result, as the increased workload is
explained by the messages themselves, with the latter message
requesting more processing to be undertaken by the former.
However, figures such as these would indicate a bottleneck if
the results are unexpected (i.e. where high-impact messages
are not intended to trigger high-cost actions on the part of the
message recipients) and so would motivate a closer examination
of the longer-running actions to increase efficiency.</p>
      <p>It may be possible to make such a deduction from viewing
the underlying agent code itself, however the use of the call
graph makes this far more easily apparent without the need for
detailed examination of the code. This also means that testers
that are not necessarily familiar with the code (or even perhaps
testers who do not understand the programming language
used) can identify bottlenecks and behavioural anomalies for
developers to address.</p>
    </sec>
    <sec id="sec-5">
      <title>VII. DISCUSSION</title>
      <p>The proposed metric for measuring the agent message impact
outlined in Section IV-B has a number of drawbacks. It operates
on the naive assumption that the actions of an agent are directly
related to the messages received by it. The impact of a message
on an agent is thus taken as the sum of the execution times of
all actions undertaken by the agent between the receipt of that
message and the receipt of the next message.</p>
      <p>The principal drawback with such an approach is that there
is no provable causal link between the receipt of messages
and the execution of actions. Agents may decide to act for
reasons other than the receipt of ACL messages. For instance,
a perceptor may have detected changes in the environment that
may require some reaction. Also, when actions are executed as
a direct consequence of the receipt of an ACL communication,
there is no guarantee that all of the relevant actions have been
performed prior to the receipt of the next message. Thus the
agent message impact arising from the receipt of a single
message may not be particularly informative.</p>
      <p>Ideally, the best method of measuring the impact of the
receipt of an ACL message would be to track the internal
reasoning process of the agent, so as to identify those actions
that are performed as a direct result of the receipt of a message
and take only these into account when calculating the message
impact. This is, however, a particularly difficult task, as the
reasoning used by agents is extremely platform-dependent and
would require a substantial amount of work to be performed
in order to port AgentSpotter to other agent platforms and
frameworks. This contravenes one of the fundamental aims of
AgentSpotter, which is intended to be as platform-agnostic as
is practicable.</p>
      <p>Even if we are to settle for a framework-specific profiling
system, the task of identifying direct causal links between
events is also non-trivial. Whereas some agents may contain
straightforward agent code that reacts to the receipt of a
message by always invoking a particular action, this is unlikely
to always be the case. Receipt of a message may alternatively
lead to a refinement of an agent’s goals, or even more subtly,
an alteration of its current belief state, which in turn may result
in goal refinements. Goals may be adopted based on the entire
belief set, making it difficult to ascertain for certain whether
the belief triggered by the message was a cause of the change
in the agent’s goals or a merely coincidental occurrence. Even
when goals have been adopted, a plan selection algorithm is
typically used to decide upon the best path to take towards
satisfying those goals. Again, this is a potentially difficult
process to trace reliably.</p>
      <p>Although the proposed measure does have drawbacks and
is somewhat simplistic, it is also important to highlight the
benefits of such a measure. Whereas a high impact measurement
for a single message may not be indicative of a major
system bottleneck (and may indeed be merely coincidental),
consistently high impact measures for similar types of messages
are far more likely to be a result of a causal link between the
receipt of the message and the processing that follows. It is
this type of analysis that makes the call graph a useful tool in
identifying situations that result in a high processing load and
thus aid in helping developers concentrate on the appropriate
portions of the code base to improve system efficiency.</p>
    </sec>
    <sec id="sec-6">
      <title>VIII. CONCLUSIONS AND FUTURE WORK</title>
      <p>We have proposed a new visualisation, the call graph
tree view, in order to provide detailed information about the
performance impact of agents interactions. After discussing the
concept of call graph in a traditional programming context, we
have then mapped it into an agent-oriented concept based on
the idea that when an agent sends an ACL message to another,
its impact on the amount of processing the recipient perform
can be measured and used to identify system bottlenecks,
load imbalances and efficiency issues. Although the proposed
measure is not optimal, it does provide users with data that is
appropriate and useful in the context of a profiler application.
We have then extended this notion to a tree model with multiple
levels: session, message emitter, message receiver, message.
Finally, we have described the advanced user interface that
allows developers and testers to interact with this model in the
form of a zoomable and searchable tree view.</p>
      <p>For further development of the call graph view of the
AgentSpotter application, there are two principal areas for
improvement. Firstly, as we have acknowledged in Section VII,
the current measure for gauging the processing impact of a
message being passed between agents is not an ideal one. We
intend to investigate other possible measures that will include
a stronger causal link between the receipt of a message and the
resulting processing activity. In doing so, the other AgentSpotter
views (flat profile and space-time diagram) will be utilised to
ensure that any proposed measures reflect the reality of the
system’s execution as closely as possible.</p>
      <p>The second significant area of future work is in the area
of agent conversation protocols. The work presented in this
paper considers each ACL message to be entirely independent
of all other messages. The reality of agent communication
is somewhat different. In the agent architecture presented
as the benchmark application in Section VI, some overseer
agents request that worker agents perform certain tasks. In our
simple application, this is done by means of a single message
containing the work request being sent to the worker. In reality,
a more complex conversation would be used. The initial request
for a task to be performed may be answered with an acceptance
or rejection of the task being assigned, followed perhaps by
the communication of the result of the task. Clearly, an agent
accepting and performing a task will consume more processing
resources than when it is rejected. However, in the existing
model, both scenarios will be grouped together, under the
initial message requesting action. Such behaviour may mask
inefficiencies in the processing code by including the low-cost
rejection actions in its session percentages. By introducing an
additional conversation level into the tree, these situations can
be separated, meaning that actions will be grouped according
to entire agent transactions rather than single messages.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R.</given-names>
            <surname>Bordini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Braubach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dastani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Seghrouchni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gomez-Sanz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Leite</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. O</given-names>
            <surname>'Hare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pokahr</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          , “
          <article-title>A survey of programming languages and platforms for multi-agent systems</article-title>
          ,” Informatica, vol.
          <volume>30</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>33</fpage>
          -
          <lpage>44</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>D.</given-names>
            <surname>Doan Van Bien</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lillis</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Collier</surname>
          </string-name>
          , “
          <article-title>Space-time diagram generation for profiling multi agent systems</article-title>
          ,”
          <source>in Proceedings of PROMAS'09</source>
          , Budapest, Hungary, May
          <volume>11</volume>
          -12th
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>D. E.</given-names>
            <surname>Knuth</surname>
          </string-name>
          , “
          <article-title>An empirical study of FORTRAN programs</article-title>
          ,
          <source>” j-SPE</source>
          , vol.
          <volume>1</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>105</fpage>
          -
          <lpage>133</lpage>
          , Apr./Jun.
          <year>1971</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S. L.</given-names>
            <surname>Graham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. B.</given-names>
            <surname>Kessler</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. K.</given-names>
            <surname>Mckusick</surname>
          </string-name>
          , “
          <article-title>Gprof: A call graph execution profiler,” SIGPLAN Not.</article-title>
          , vol.
          <volume>17</volume>
          , no.
          <issue>6</issue>
          , pp.
          <fpage>120</fpage>
          -
          <lpage>126</lpage>
          ,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Sun</given-names>
            <surname>Microsystems</surname>
          </string-name>
          , Inc., “
          <article-title>JVM Tool Interface (JVMTI), Version 1</article-title>
          .0,” Web pages at http://java.sun.
          <source>com/j2se/1</source>
          .5.0/docs/guide/jvmti/ (accessed
          <year>August 4th</year>
          ,
          <year>2008</year>
          ),
          <year>2004</year>
          . [Online]. Available: http: //java.sun.
          <source>com/j2se/1</source>
          .5.0/docs/guide/jvmti/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Srivastava</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Eustace</surname>
          </string-name>
          , “
          <article-title>Atom: a system for building customized program analysis tools,” in PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation</article-title>
          . New York, NY, USA: ACM,
          <year>1994</year>
          , pp.
          <fpage>196</fpage>
          -
          <lpage>205</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Helsinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Thome</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Wright</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Technol</surname>
          </string-name>
          , and M. Cambridge, “Cougaar:
          <article-title>a scalable, distributed multi-agent architecture</article-title>
          ,
          <source>” in Systems, Man and Cybernetics</source>
          , 2004 IEEE International Conference on, vol.
          <volume>2</volume>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>G.</given-names>
            <surname>Rimassa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Calisti</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. E.</given-names>
            <surname>Kernland</surname>
          </string-name>
          , Software
          <string-name>
            <surname>Agent-Based</surname>
            <given-names>Applications</given-names>
          </string-name>
          , Platforms and Development Kits, ser.
          <source>Whitestein Series in Software Agent Technologies and Autonomic Computing. Birkha¨user Basel</source>
          ,
          <year>2005</year>
          , ch.
          <source>Living Systems R Technology Suite</source>
          , pp.
          <fpage>73</fpage>
          -
          <lpage>93</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>R.</given-names>
            <surname>Collier</surname>
          </string-name>
          , “
          <source>Debugging Agents in Agent Factory,” Lecture Notes in Computer Science</source>
          , vol.
          <volume>4411</volume>
          , p.
          <fpage>229</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>C.</given-names>
            <surname>Seah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sierhuis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Clancey</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Cognition</surname>
          </string-name>
          ,
          <article-title>“Multi-agent modeling and simulation approach for design and analysis of MER mission operations,” in Proceedings of 2005 International conference on human-computer interface advances for modeling and simulation (</article-title>
          <source>SIMCHI'05)</source>
          ,
          <year>2005</year>
          , pp.
          <fpage>73</fpage>
          -
          <lpage>78</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H.</given-names>
            <surname>Nwana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ndumu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Lee</surname>
          </string-name>
          , “ZEUS:
          <article-title>An advanced tool-kit for engineering distributed multi-agent systems</article-title>
          ,
          <source>” Applied AI</source>
          , vol.
          <volume>13</volume>
          , no.
          <issue>1</issue>
          , p.
          <fpage>2</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>F.</given-names>
            <surname>Bellifemine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Caire</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Greenwood</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Corporation</surname>
          </string-name>
          ,
          <article-title>Developing multi-agent systems with JADE</article-title>
          . Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>J.</given-names>
            <surname>Botıa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hernansaez</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Skarmeta</surname>
          </string-name>
          , “
          <article-title>Towards an Approach for Debugging MAS Through the Analysis of ACL Messages ,”</article-title>
          <source>Computer Systems Science and Engineering</source>
          , vol.
          <volume>20</volume>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>R.</given-names>
            <surname>Collier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. O</given-names>
            <surname>'Hare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lowen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Rooney</surname>
          </string-name>
          , “
          <article-title>Beyond Prototyping in the Factory of Agents,” Multi-Agent Systems and Application III: 3rd International Central</article-title>
          and
          <source>Eastern European Conference on MultiAgent Systems</source>
          ,
          <year>Ceemas 2003</year>
          , Prague, Czech Republic, June 16-18,
          <year>2003</year>
          : Proceedings,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>