Chapter 6. BDI Tracer

The tracer is accessible from the Jadex Control Center tool menu. It is a tool inspired by the Ph.D. work of Dung N. Lam working on agent software comprehension with abductive reasoning. The tracer provides basically an interface and means to log the internal state of a BDI agent, and to analyze and visualize the logged information. It is made of two components. The first one is the TracerAdapter placed in front of an agent as a tool adapter. It is responsible for filtering messages concerning the tracing process away from the message queue of an agent and it collects the information about agent's internal state changes and other occurrences in the system. The information is then sent to the Tracer Agent, if an instance is present on the platform. The latter has the duty to analyze the traces, store them, and to present them to the user in a graphical form.

6.1. Main Window

The main window of the tracer agent may be seen in Figure 6.1, “Tracer Main Window”. The traces presented here are from the Blocksworld example. In order to indicate a type of traces, they are marked with icons and their different meaning is explained in Table 6.1, “Information logged by the tracer”. The tracer perspective is split into three views including a tree view of agents and traces, a tabular view of traces and a 2D trace space exploring panel.

Tracer Main Window

Figure 6.1. Tracer Main Window

Table 6.1. Information logged by the tracer

Actions describe internal processes of an Agent and are by default ignored by the tracer.

Beliefs are meta traces, that collect all traces concerning the use of beliefs and their change.

Belief read and write access indicate that an agent or its plans have accessed a belief and possibly changed it.

The icons stand for message receive or send events respectively.

Goals are traced when they are adopted by the agent.

Plans are shown, when created in response to a goal or event.

Events represent any agent state changes.

6.1.1. Trace Tree

At the left there is a tree view showing all Jadex BDI agents known to the tracer. The meaning of a particular icon depicting an agent is shown in Table 6.2, “State of an agent”. Descending from the BDI agents, all traces are linked beneath nodes identified to be their cause.

Table 6.2. State of an agent

The agent did not send any traces yet.

The agent sends its traces to the tracer.

The agent is ignored by the tracer.

The agent died.

The functionality provided by the tree popup menu is similar to the functionality from the Agent Menu (Section 6.2.1, “Agent Menu”) and concerns the currently selected trace or agent. In the case of an agent the user may choose to observer it and to adjust the trace filter and history limit ( Filter ). The other options allow to show or hide traces in the graph or table. With the last menu item the trace or the agent may be removed from the tracer perspective.

Tree Popup Menu

Figure 6.2. Tree Popup Menu

6.1.2. Trace Table

On the right there are two views. The upper one shows a tabular view of the traces. The traces are ordered in sequence they arrive. The table shows information like a unique trace id. For plans and goals it is the instnace name. For beliefs it is the name of the belief. Also shown is the value, causes and the time this trace happened. The value show the content of a specific trace. For beliefs it is the value of the beliefs. For plans and goals, the string representation of the runtime instance.

The user may select traces in the table based on different criteria, remove them from the table, show them in the graph panel or delete from the tracer perspective. All the fuctionality is accessible under the Table Menu (Section 6.2.2, “Table Menu”) and a coresponding popup menu.

6.1.3. Trace Exploration Graph

The lower of the two right views is the graph panel allowing to explore the space of traces. It also allows to multiple presentation options, navigation and choice of among the traces. All this functionality may be accessed from the Graph Menu (Section 6.2.3, “Graph Menu”) and a graph popup menu (Figure 6.5, “Graph Popup Menu”).

6.2. Menus

The menu provides access to functions concerning the tracer agent itself and the BDI agents analyzed. Functions corresponding to the tabular view and the 2D graph view are also accessible from here.

6.2.1. Agent Menu

Under this menu (cf. Figure 6.3, “Agent Menu” concerning agents the user has the option to:

  • Observe - an agent. This will tell the agent to send its traces to the tracer.

  • Observe all - will cause all BDI agents (known to the tracer) to send their data.

  • Ignore - an agent. Has the complementary effect to Observe.

  • Ignore all - is the reverse of Observe all.

  • Ignore at first - causes the tracer to ignore all newly occurring agents.

  • Show in graph - tells the tracer to show the traces of an agent in the 2D graph as soon as they arrive.

  • Hide from graph - removes all agent traces from the 2D graph.

  • Show in table - tells the tracer to show the traces of an agent in the table.

  • Hide from table - removes all agent traces from the table.

  • Delete - removes the agent and corresponding traces from all views.

  • Delete dead agents - removes all dead agents and their traces from all views.

  • Filter - shows a filter dialog for the current selected agent.

  • Default filter - shows a filter dialog for a prototypical agent all new agents will inherit their properties from.

Agent Menu

Figure 6.3. Agent Menu

6.2.2. Table Menu

The Table menu (cf. Figure 6.4, “Table Menu” ) provides functionality concerning the table view. Following options are available to the user:

  • Select causes - selects immediate causes of selected traces.

  • Select effects - selects the immediate effects.

  • Show in graph - shows all selected traces in the 2D graph.

  • Hide in graph - hides selected traces from the 2D graph.

  • Remove - removes traces from the table.

  • Delete - deletes the traces and removes them from all views.

  • Scroll - tells if the table should be scrolled, when new traces arrive.

Table Menu

Figure 6.4. Table Menu

6.2.3. Graph Menu

The tracer graph menu is accessible from the main menu and as pop-up in the graph view(cf. Figure 6.5, “Graph Popup Menu” ). It provides access to following functions:

  • Show - is used to show actions, beliefs or messages connected to trace nodes already shown in the graph. If a trace is selected, the user may choose to show the causes and effects of that trace.

  • Hide - hides actions, beliefs or messages from the graph view. A single trace, its causes or its effects may be removed form the view.

  • Expand - will expand the trace by one level of the causes or effects.

  • Collapse - will shrink and hide the traces around the selected one.

  • Delete - will remove the trace from all views in the tracer.

  • Join Beliefs - may be used to collapse all belief access nodes into a single one.

  • Join Messages - will join the send and receive events of a message with an edge, therefore establishing connections between agents.

  • Labels - this check-box indicates that the traces in the graph should be shown with thier corresponding labels instead of an anonymous icon. The labels ar turcated by length and a selected trace is always shown with its label.

Graph Popup Menu

Figure 6.5. Graph Popup Menu

6.3. Agent Filter Dialog

Agent Filter Dialog

Figure 6.6. Agent Filter Dialog

The filter dialog can be accessed from the Agent Menu or from the agent popup menu (see Figure 6.6, “Agent Filter Dialog” ). There is also a Default filter menu item allowing to set the same values for a prototypic agent used for new agents introduced to the tracer.

It allows the user to customize, what kind of traces are interesting for her. The trace type filter can be used to choose among different kinds of traces. The fillter will pass all traces by kind if the corresponding check box is marked. The limit of trace history below allows to store only a specified number of traces in the tracer and may be set for each agent. Moving the slider to the right-most position implies that no limit will be enforced.

Changes in the dialog are applied immeadiately. The dialog will hide when it looses the focus.