Assignment #3

Assignment #3


1. Background
This assignment completes the remaining Personal Agents from Chapter 8 including; the Scheduler, UserNotification, and Airfare agents. It also adds Chapter 9 – Information Filter Agent for reading and implementation of the InfoFilter application.

The functional specifications are still a good reference point and I’m going to go ahead and leave them in the document:
a. It must be easy to add an intelligent agent to an existing Java application.
b. A graphical construction tool must be available to compose agents out of other Java components and other agents.
c. The agents must support a relatively sophisticated event-processing capability. Out agent will need to handle events from the outside world or from other agents, and signal events to outside applications.
d. We must be able to add domain knowledge to our agent using if-then rules, and support forward and backward rule-based processing with sensors and effectors.
e. The agents must be able to learn to do classification, clustering, and prediction using learning algorithms.
f. Multi-agent applications must be supported using a KQML-like message protocol.
g. The agents must be persistent; once an agent is constructed, there must be a way to save it in a file and reload its state at a later time.

The framework is intended to be used in a specific sequence so that the CIAgent State follows a predictable set of transitions. The life cycle of a typical CIAgents should progress as follows:
a. Construct the CIAgent object instance. Set the state to UNINITIATED.
b. Either programmatically or using a Customizer, set the JavaBean properties.
c. Call the initialize() method. Set the state to INITIATED.
d. Call the startAgentProcessing() method to start the eventQueue thread and any asynchronous event and timer processing. The state is set to ACTIVE.
e. Use the agent in an application by calling the process() method directly, or by sending events to be processed asynchronously.
f. Suspend and Resume the agent as needed. The state is set to SUSPENDED or ACTIVE.
g. Stop the agent. The state is set to UNKNOWN.

The original BooleanRuleBase we experimented with in Assignment #1 has been enhanced to provide support for Sensors and Effectors. Sensors are what allow our agents to gather information about its environment. Once the agent has recognized that a significant event has occurred it can then take some action through an Effector. This is the beginnings of intelligence for our agents.

Chapter 8 introduces the Personal Agent Manager application. This basic GUI platform allows us to create, configure, and control a set of personal agents that will do tasks on our behalf. The assignment picks up from where we left off in the Assignment 2.

2. Implementation of the Framework
The Personal Agent Manager Application is used to activate the remaining agents. These results are detailed below.

Scheduler Agent – used to establish and trigger alarms. The alarms may be single instances or recurring at specified intervals. When an alarm condition occurs, the SchedulerAgent sends a CIAgentEvent to all of its registered listeners. This essentially allow the agent to act as a task manager by tasking other agents to accomplish certain jobs at specified times or intervals.


The UserNotification Agent is a simple agent that provides a centralized user interface for the display of notification messages and can be used by multiple agents in the system.


These two agents make up a form of “support staff” that coordinate the activities of the worker agents.
The worker agent in this case is the AirfareAgent. The Airfare agent uses a rule base and forward chaining to determine when a published airfare is of interest to the user. This agent allows the user to specify desired parameters for an upcoming travel event. The agent then monitors a reservations site waiting for airfares that meet the user criteria. The rule set used is fairly extensive and in this case manually coded.


The sample code does not deal gracefully with Internet sites that change often. This is a continual problem with any automated tool that need to scrape information of an Internet screen. The authors provided a static website that would interact with the sample code.

Activation of the Airfare agent requires a specific startup sequence:
1. Create a UserNotification Agent and Initialize it.
2. Create an AirfareAgent and use the drop down list to select the UserNotification Agent created in step 1.
3. Initialize the Airfare Agent
4. Create a SchedulerAgent, set the interval to 15 seconds, and use the drop down list to select the AirfareAgent created in step 2. Set the Action string to process and then Initialize the agent.
5. Start all the Agents.
6. Every time the SchedulerAgent fires (15 secs), an event is sent to the Airfare Agent which then goes out and looks for a good deal. When a flight is found that matches the rule base criteria, an event is sent to the UserNotification Agent which then notifies the user.


Unfortunately, the supporting website is no longer functional:


So I could not actually test this application.

3. Chapter 9 – InfoFilter Application
This agent is designed to be a general purpose information filter. There are several supporting agents that gather source information:
NewsReaderAgent – can connect to an Internet Usenet News server, request articles from designated newsgroups, and download all or a subset of the articles for analysis.
URLReaderAgent – reads data from a designated Web Page, downloads the text, and scores the text against a keyword list and optionally against two neural networks.
Once the application is compiled the main InfoFilter window is used to access the other agents. The first task is to configure the NewsReaderAgent to download the selected newsgroups. I chose to use the example groups in the book;,,,, and I had some difficulty finding a news server that was accessible but eventually got enough to work with.


Once the articles were downloaded I erased the existing profile data and then retrained the Neural Networks again.


Then I was able to access the different Filters using the drop down menu. Here is the scoring by Keyword:


Using the Feedback Filter:


And finally, using Clusters.


The URL Reader is a much simpler application that allows a single web page to be downloaded and analyzed:



This agent was limited to keyword scoring.

4. Conclusion
I can already think of a couple of ideas where I might be able to put this to use. I quit looking at Usenet years ago when it got so cluttered up. I can see where this would help to filter out the garbage and make my time much more productive. I would also like to create an agent that searched the Internet for Photo Contests that I could enter.