The Developer's Guide

Release 3.0


Table of Contents

Colofon
1. Copyright Information
2. Acknowledgement of Trademarks
3. Warning and Disclaimer
4. Contact Tryllian
1. About the Developer's Guide
1.1. About this guide
1.2. Manual typographical conventions
1.3. The Developer website
1.4. Command line conventions
1.5. Reporting bugs
2. The ADK Environment
2.1. About this chapter
2.2. Why Agents?
2.3. Agents and artificial intelligence
2.4. When to use the ADK
2.5. The ADK Environment
2.6. The Agent System
2.6.1. Sense
2.6.2. Reason
2.6.3. Act
2.6.4. Agent task
2.6.5. Task Scheduler
2.7. Building agent applications
2.8. Design considerations
2.8.1. The number of habitats
2.8.2. Agent roles
2.8.3. Task models
2.8.4. Messaging and communication
2.9. Getting Started
3. Technical Overview of the ADK
3.1. About this chapter
3.2. System requirements
3.3. Organization of the development kit
3.3.1. Agent Foundation Classes (AFC)
3.3.2. Agent Runtime Environment (ARE)
3.4. The Agent Template
3.4.1. Compiling agents and deployment
3.4.2. Template structure
3.4.3. Creating new agents
3.4.4. Using external libraries
3.4.5. More complex projects
4. Developing with the ADK
4.1. About this chapter
4.2. Agent aspects
4.2.1. Identity
4.2.2. Addressing Agents
4.2.3. Security Information
4.3. Behavior
4.4. Memory
4.5. Life Cycle
4.6. Communication
4.6.1. Messages
4.6.2. FIPA
4.6.3. Language
4.7. DNA Files
4.8. Agent Persistence
5. Agent Creation
5.1. About this chapter
5.2. Creating your first agent
5.2.1. Set-up your programming environment
5.2.2. Creating java files
5.2.3. Compile and package
5.2.4. Create DNA File
5.2.5. XML files
5.2.6. Run
5.3. Mobility
5.3.1. EXAMPLE: Sending the agent on a mission
5.4. Moving out of the example directory
5.5. Coding your own agent
5.5.1. Format of the Habitat XML file
5.6. System Agents
5.7. DNA Composer
5.7.1. Usage
5.7.2. Creating new DNA files
5.7.3. Updating existing DNA files
5.7.4. Parameters
5.7.5. Errors
5.7.6. Examples
5.8. Creating DNA from your ANT build script
5.8.1. The Trylliant library
5.8.2. The DNA target
5.9. Agent Deployment Tool
5.9.1. Startup
5.9.2. Setup
5.9.3. Construction
5.9.4. Deployment
6. Configuration Issues
6.1. About this chapter
6.2. Network configuration
6.2.1. Configuring messenger plugins
6.2.2. JXTA Messenger Plugin Network Configuration
6.2.3. HTTP Messenger Plugin
6.2.4. JMS Messenger plugins
6.3. Starting the habitat and adding libraries to the ADK
6.4. Running a habitat using debuggers
6.4.1. JBuilder
6.4.2. Visual Cafe
6.4.3. Eclipse
6.4.4. Netbeans
7. The Agent Task Model
7.1. About this chapter
7.2. Why use the Task Model?
7.3. How the task model is implemented?
7.3.1. Task States
7.3.2. Asynchronous actions
7.3.3. The Agent heartbeat
7.4. The Task Model API
7.4.1. The Task interface
7.4.2. Task State
7.4.3. Events and Listeners
7.4.4. AgentContext
7.4.5. The Directory
7.4.6. Derived task classes
7.5. Programming with tasks
7.5.1. Common tasks
7.5.2. Finding Agents
7.5.3. Messaging
7.5.4. JNDI Groups
7.5.5. Statistics
7.5.6. Other tasks
8. Programming with Tasks
8.1. About this chapter
8.2. Creating a simple agent with proactive behavior
8.2.1. Step 1: Create a habitat configuration file.
8.2.2. Step 2: Create an agent descriptor file.
8.2.3. Step 3: Create an agent.
8.2.4. Step 4: Create a task.
8.2.5. Step 5: Putting it all together.
8.3. Task scheduling example
8.4. Making tasks trigger other tasks
8.5. Reactive behavior
8.6. Debugging
8.7. More information
9. Behind Agent Communication
9.1. About this chapter
9.1.1. Protocol
9.1.2. Language
9.2. The FIPA Protocol
9.3. The Tryllian subset
9.4. Guidelines for creating agent languages
9.4.1. Subject capitalization
9.4.2. Naming your subjects
9.4.3. Naming of request type messages
9.4.4. FIPA-required message parameters
9.4.5. Interaction patterns
9.5. The ADK's own languages
9.5.1. The Basic Language (tryllian.basic)
9.6. Conclusion
10. Communicating with Agents
10.1. About this chapter
10.2. The Message API
10.2.1. Message structure
10.2.2. Message interface
10.2.3. Creating messages
10.2.4. Sending and receiving messages
10.3. Sending messages
10.4. Receiving messages
10.4.1. Messages and Tasks
10.4.2. Basic Messaging example
10.4.3. Running the example
10.5. Conversations
10.5.1. Creating and using a Conversation
10.5.2. Conversation example
10.5.3. Running the example
10.6. Message filtering
10.7. Inspecting messages
10.8. Object Messaging
10.8.1. Storing an object in a message
10.8.2. Retrieving an object from a message
10.8.3. Creating and registering new codecs
10.9. File Transfer between Agents
10.10. Standalone Messenger
10.11. Communication with JMS
10.11.1. Description of the JMS tasks
10.11.2. Configuration of the server
10.11.3. Creating agents
11. Persistence
11.1. About this chapter
11.2. Agents
11.2.1. General requirements for persistence
11.2.2. Checkpointing
11.2.3. Suspending
11.2.4. Binary and logical persistence
11.2.5. Transient agents and JNDI
11.3. Habitats and Databases
11.3.1. Database support
11.3.2. Installing and using persistence
11.3.3. Scenarios
12. Security
12.1. About this chapter
12.2. The Big picture
12.3. Giving specific permissions to agents
12.4. Habitat permissions
12.5. The Security system
12.6. Trust chain
12.7. ARE security files
12.7.1. NoCert
12.7.2. Basic
12.7.3. All
12.7.4. How security works
12.8. Keystores
12.8.1. Overview
12.9. The Key Tool
12.10. Certificates
12.10.1. Creating a certificate
12.10.2. Managing Certificates
12.11. Signing jar files
12.12. Hints and Tips
12.12.1. Security related error messages and what to do
12.12.2. How does the security system determine access rights?
12.12.3. How do I check if a DNA file is correctly signed?
12.13. Conclusion
13. Habitat Monitoring and Management
13.1. About this chapter
13.2. Logging
13.2.1. About logging
13.2.2. The LogParser
13.3. Temporary files in the Jar Cache
14. Web Services
14.1. About this chapter
14.2. What is a Web Service?
14.3. Simple Object Access Protocol (SOAP)
14.4. Web Service Description Language (WSDL)
14.5. Universal Discovery, Description and Integration (UDDI)
14.6. Integration of Web Services into ADK
14.6.1. Agent as a Web Service client
14.6.2. Agent as a Web Service
15. Using Web Services with the ADK
15.1. Web Service support in the ADK
15.2. What is possible with Web Services
15.3. Creating an agent that queries a UDDI server to find a Web Service
15.4. Finding a business by name: UDDIWhitePagesSearchTask
15.5. Another way to find a business: UDDIYellowPagesSearchTask
15.6. Finding services of a known business: UDDIRetrieveWebServicesTask
15.7. Finding the AccessPoint URL and other details of a known service: UDDIRetrieveAccessPointTask
15.8. Custom UDDI inquiries that go beyond the current tasks
15.9. Integrating a generated Web Service client into an agent
15.10. SOAP Calls - RPC and doc style messaging
15.11. SOAP clients and servers
15.12. Two types of Web Service calls
15.13. RPC calls
15.14. Calling a Web Service from within agent tasks of the Tryllian agent toolkit
15.15. Document Style Messaging
15.16. References to Web Services resources
15.16.1. General links
15.16.2. SOAP interoperability
16. Software Licensing Requirements
16.1. About this chapter
16.2. Components distributed with the ADK
16.3. Impact on customers
16.4. More license information
Glossary
A. References and Resources
Index

List of Figures

2.1. Agent Behavior
5.1. A new, nameless Agent
5.2. Classes used by MyAgent
5.3. Libraries used by MyAgent
5.4. Resources used by MyAgent
5.5. Security settings for MyAgent
5.6. Deployment of MyAgent
7.1. Task State diagram
7.2. Diagram of Derived Task Classes.
7.3. ExampleScheduler.
9.1. Query-ref interaction.
9.2. Request interaction.
9.3. Subscribe/Cancel interaction.
12.1. Certificate Authorities.
12.2. Screen Shot with Generated KeyPair.
12.3. Screen Shot showing Certificate Properties.
12.4. Signing jar files.
14.1. The three basic operations involved in Web Services.
14.2. Extended Messenger Service.

List of Tables

7.1. Task Model package tryllian.afc.task
7.2. Task interface (in tryllian.afc.task)
7.3. MoveListener interface (in tryllian.afc.task)
7.4. AbstractTask interface (in tryllian.afc.task)
7.5. public class TaskScheduler extends AbstractTask (in tryllian.afc.task) TaskScheduler (Task[] tasks) creates a new TaskScheduler and adds all tasks in the given array to it.
9.1. The Tryllian FIPA performative subset
10.1. Public interface Message in tryllian.afc.message
10.2. Public interface OutgoingMessage in tryllian.afc.message
10.3. Public class IncomingMessage in tryllian.afc.message
10.4. Public class DefaultMessageFilter in tryllian.afc.message
13.1. Channel interface in tryllian.log
13.2. ChannelHelper interface in tryllian.log
13.3. LoggingConstants interface in tryllian.log

List of Examples

4.1. Some well-formed addresses
4.2. Habitat naming convention
4.3. Address with agent hierarchy
5.1. An example Habitat XML file
5.2. DNA ANT usage
7.1. Task scheduling
10.1. Creating OutgoingMessage objects using existing classes
10.2. Sub-classing message classes (pseudocode)
10.3. Sending messages
10.4. The SendingMessageAgent and ReceivingMessageAgent example
10.5. The AnswerAgent and GuesserAgent example using a Conversation.
10.6. Using message filtering with GuesserTask to handle incoming messages.
10.7. A simple agent PrintMessageAgent and a task PrintMessageTask.
10.8. Using the toString method of an IncomingMessage.