Table of Contents
This example explains the following features:
Adding (3rd party) jars to your DNA file
Adding jars as "shared reference".
To use an extra JAR file, perform the following three steps:
Add the jar to your classpath (edit build.properties).
Modify DNA ANT target (edit build.xml).
Modify the descriptor (create/modify a file in the descriptors directory).
The chat3 example uses the regular expressions library to process incoming messages. The sources can be found in scenarios/src/tryllian/scenarios/chat3 directory
ChatterAgent3.java (The chatter agent) PatternChatterGenerator.java (Generates simple responses) ReplyToChatterTask2.java (Tasks that answers chatter agents)
Look at project.classpath in the build.properties file, the structure of the chat3 target in the build.xml file and the descriptor file descriptors/chat3.descriptor.xml.
The link to the build.xml file may not work with all browsers.
To compile the example, type in the scenarios directory :
build chat3
To run the example:
habitat chat3.xml
Adding a jar to every agent can take up a lot of extra disk space, especially if you have many different agents. In that case, consider including the jar as a "shared reference". In this situation, there is only one copy of the jar and all agents will carry a reference to it. An example of a shared reference is the AFC, the class library every agent uses.