In the introspector perspective you can observe and manipulate
the internal state of agents.
In Figure 6.1, “Introspector overview” the introspector
is shown while observing an agent from the marsworld example.
You can use the agent tree at the left side to select agents you want to observe
(by double clicking or using the popup menu).
The observation view for the selected agent is shown
on the right side. In the observation views four different panels can be seen
and chosen.
The "Beliefbase", "Goalbase" and
"Planbase" tabs show the contents of the belief, goal
and plan base, respectively. Alle these panels are described in
Section 6.1, “Base Panels”. The
"Debugger" tab allows to observe and control the event processing,
consisting of plan selection and execution in the
debugger panel.
When an agent is chosen for observation only those panels are initially
active that have been defined in the "Default Options" menu (active here
means that the views are continuously refreshed). If you want to activate
or deactivate a specific panel this can be done by using the start and
stop buttons from the menu bar. For making the state difference obvious
in a deactivated panel the background color will switch from white to light grey.
Below the tabs in the observation window, a details panel shows details of elements (e.g. beliefs or events) selected with double click. This details panel is shared by all activated tabs, and therefore shows the last elements selected in any tab.
Three base panels show the beliefs (), goals (
), and plans (
) of the selected agent.
They are very similar in their usage (see
Figure 6.2, “The Beliefs Panel of Introspector”).
All elements are shown in a tree structure
representing the containment hierarchy of the elements
in the capabilities of the agent.
The different elements of the agent are shown with different icons as explained in Table 6.1, “Introspector Base Panel Elements”. For each element the most important attributes are displayed directly in the tree/table structure. The content of the base panels will automatically be updated when changes occur inside the agent.
Table 6.1. Introspector Base Panel Elements
Element | Description |
---|---|
|
The agent containing all other elements |
|
The capability with its contained elements |
|
The beliefbase containing all beliefs of a capability |
|
A single fact belief, or fact contained in a belief set |
|
A belief set containing a number of facts |
|
A belief visible in this capability, but declared elsewhere |
|
A belief set visible in this capability, but declared elsewhere |
|
The plan base containing all plans of a capability |
|
A currently running plan |
|
The goalbase containing all goals of a capability |
|
A currently adopted perform goal for executing actions. |
|
A perform goal reference on a currently adopted perform goal. |
|
A currently adopted achieve goal that aims at establishing a specified world state. |
|
An achieve goal reference on a currently adopted achieve goal. |
|
A currently adopted query goal that aims at fetching some information. |
|
A query goal reference on a currently adopted query goal. |
|
A currently adopted maintain goal that aims at monitoring and re-establishing a specified world state. |
|
A maintain goal reference on a currently adopted maintain goal. |
|
A meta goal that is used for deciding among different applicable plans for one goal or event. |
|
A reference to a meta goal. |
The tree component allows nodes to be closed to focus on interesting subsets of the agent's functionality. The column widths can be (auto-) adjusted by dragging or double-clicking between the column headers. The table headers also provide a popup->menu (opened with right-click) that allows to hide some of the columns for better readability. You can double click on the elements to see more detailed information. The details panel is not automatically updated, you may have to double click the element again, to see up to date information.
You can to some extent manipulate the elements shown in the base panels. E.g. you can alter the values of facts in the beliefbase. Double click on the fact value you wish to change (in the value column), and then enter the new value as Java expression (i.e "text" for a string value). The expressions are evaluated using the imports as specified in the ADF (of the corresponding capability) therefore you can write expressions just as you would do that in a <fact> tag of the ADF. In addition, popup menus are available e.g. to remove beliefs, terminate plans or change the state of goals.
Some options are available to influence the appearance of the base panels (see Table 6.2, “Introspector Base Panel Options”).
Table 6.2. Introspector Base Panel Options
|
Resize all columns to fit to length of contained entries |
|
Show / hide removed elements (e.g. finished plans) |
|
Flush removed elements from memory |
|
Toggle goalview / planview (only for goalbase tab) |
The resize icon allows to auto-adjust the widths of the table columns to fit the displayed content. The next two icons are concerned with the presentation of removed elements. Because the final state of a goal or a plan may be of interest after the goal has been dropped or the plan has terminated, the panels have an option not to remove those elements from the representation, but just visually mark them as removed. This is especially useful for debugging your agents, e.g. in conjunction with the debugger view described in the next section. To flush removed beliefs, goals and plans from the representation, you can use the waste bin icon.
The last icon is only available in the goalbase panel.
It allows to switch between the goalview and the planview representation
of the agent's current goals.
The goalview, shown by default, displays only the goals and goal
references in the context of their containing capabilities.
In the planview the global goal-plan hierarchy of the agent is
displayed. This means that the causal relationships of the
agent's goal structure are visible. Starting with some top-level
element, which can be a top-level goal or plan, it is shown which
subelements are connected with it, i.e. which plan is currently executed
for a goal, which subgoal the plan has dispatched and so forth.
Both views are compared in Figure 6.3, “Goalview and planview”.
In the planview you can see that the move_dest#11
achieve
goal was actually created by a plan as a subgoal of the
carry_ore#1
achieve goal.
The debugger panel allows watching the internal
processing inside an agent. The window is made up of the agenda area,
the agenda control area in the middle and the details view at bottom (see
Figure 6.4, “The Debugger Panel of Introspector”.
The agenda contains all current action entries of the agent, whereby entries in light-grey denote already processed actions. In addition it can be seen whether entries currently have a valid precondition and thus can subsequently be executed; otherwise they are marked as (invalid). Such invalid actions will not be executed, but just ignored by the execution mechanism. To see some more information about an agenda action you can double-click on it and inspect its values in the details view. In addition to observing the agent's internal behavior the tool also allows you to control the agenda execution by performing actions in step mode. If the execution mode is set to "step" or "cycle" you can use the "forward" button to execute as many steps as shown in the "execute <n> agenda actions" choice. The difference between step and cycle mode concerns only the execution of ProcessEventActions that are decomposed to finer-grained sub steps (FindApplicableCandidatesAction, SelectCandidatesAction and ScheduleCandidatesAction) when the "step" mode is activated. Therefore, the step mode allows you to examine the details of the BDI plan selection process what can be helpful in understanding and explaining unexpected application behavior. The "open steps" status bar shows the progress of the action execution by highlighting the number of steps the agent still has to perform whereas in the the "processing state" line it can be seen if a step is currently requested or has been finished.