Dustin Stevens-Baier
Comp 575 Multi Agents
6-20-06




To Start with I had to fix a few bugs in the code. The first bug was one in the addAgent method in the CIAgent class. When you first run the PAManagerapp you get a stack error that can be traced back to the Introspection logic in the JDK. The problem stems from the Java framework thinking that the addAgent method is a listener method. I researched how this works and found that introspection code used to get the target info of the object looks for methods that begin with the add prefix, with 1 argument and a void return value. When doing this it thinks that it is a listener method and then subtracts eight from the length and sub strings the method. This causes the out of bounds condition that I got when I first tried to implement the program.

This is fixed by replacing the void return value with CIAgent and returning the child. The java framework is no longer fooled.

After getting this bug fixed I was then able to start up the Personal Agent Manager Application.  To Create a File Agent we just go to Create and choose File Agent.




This is an example of the dialogue that pops up after we create a FileAgent app.




























After I filled out the information in the File Agent. It looked like the following. The file that I was monitoring was selected. The condition was that anytime it was monitored a notice would be sent. Then you click initialize.



























After clicking intiliaze the Personal Agent Manager Application now has a agent to watch.





The next step is to start the agent which is done by highlighting the agent and going to edit and then clicking on start processing.




This is a picture of the file being monitored before the modifications.



This is a picture of the file after modifications.


You can see the Personal Agent Manager Application displays a notification when the File agent finds out that the file has been modified. Another example is an agent that notfies when the file has been deleted.

 



Another agent type in the Personal Agent Manager Application is the scheduler agent which allows you to create agents that are like timers. You can have them go off at intervals like this example or just once.




The Personal Agent Manager Application also has an airfare agent and a user notification agent. The airfare agent looks as follows.

 



The airfare agent also required an alteration in the code. The line url = new URL(http://www.bigusbooks.com/cgi-local/airfare.pl); needed to be changed to the line url = new URL(http://www.bigusbooks.com/cgi-bin/airfare.pl); This is because the data that the program looks for to perform the airafre requests have changed.

This is an example of the airfare agent that requries the use of the scheduler agent. The scheduler agent needs to be set up to notify the airfare agent every time there is a process.

The user notification looks as follows:

















Not only do we need the user notification agent but we also need a scheduler in order to schedule the user agent. Once we have the scheduler set to notify the user notification agent at intervals. We are good to go.


Every 5 seconds the UserNotificationAgent gets notified. And the output is fed into the following window.



There was one thing that I couldn't get to work correctly that acted funny. Whenever you tried to schedule an event in the scheduler on a one time notification it would instead schedule it for an interval event every 60 seconds.


Hosted by www.Geocities.ws

1