Agent Factory Debugger
From Agent Factory
Contents |
Introduction
This is a preliminary version of the documentation that explains how to use the AF Debugger. The preliminary nature of this document reflects the embryonic state of the debugger.
Editorial History
19/08/2008: Version 1 - Basic information on the AF Debugger
01/02/2010: Version 2 - Updated to reflect version 2.0 of Agent Factory
Overview
The Agent Factory Debugger is an extensible debugging tool that can be easily customised to support different agent architectures / interpreters on a single agent platform (when using multiple platforms you will need a different instance of the debugger for each platform you are debugging).
The main interface provides basic configuration information for the agent platform, including: the name / domain of the platform and the list of agents/services that are deployed on that platform. Clicking on an individual agent opens an Agent Inspection Tool that allows you to debug the state of an individual agent.
Installing and Configuring the Debugger
Installing and running the debugger involves adding two lines of code to the Main class that you are using to start your agent platform:
Debugger debugger = new Debugger(platform); debugger.start();
This loads the basic Debugger with the basic Agent Inspector Tool installed. To configure the debugger to support a custom inspection tool, you need to associate two classes with the debugger:
- A StateManagerFactory class is required to associate a custom state manager with the debugger. The state manager is the part of the debugger that captures a snapshot of the agent state upon request. The default implementation captures only information about bound platform services and incoming/outgoing messages.
- An InspectorFactory class is required to associate a custom agent inspector with the debugger. Custom agent inspectors typically add additional views to the default inspector to allow the visualisation of the additional state information that has been captured by the corresponding state manager.
For more information on how to develop your own state managers and inspectors, see the article on Developing Your Own Agent Inspector.
To use the inspectors provided by AFAPL2 or AF-AgentSpeak use the following code:
// Add the AFAPL2 Inspector & State Manager debugger.registerInspectorFactory(new AFAPL2InspectorFactory()); debugger.registerStateManagerFactory(new AFAPL2StateManagerFactory()); // Add the AF-AS Inspector & State Manager debugger.registerInspectorFactory(new AgentSpeakInspectorFactory()); debugger.registerStateManagerFactory(new AgentSpeakStateManagerFactory());
Agent Inspection Tool
Explain the default tool and then discuss AFAPL2 / AF-AS / AF-RMA support.
The debugger provides a default (basic) inspector for all kinds of Agent Factory agent. This inspector includes two basic views:
- the platform services that the agent is currently bound to
- the messages that are send / received by the agent during each iteration of its control algorithm
In addition, the default debugger allows:
- browsing of the historical snapshots of the agent state
- starting, stopping and stepping of the inspected agent
A screenshot of the default agent inspector is provided below.
