AI2 project

links

Hi, I propose to define the common contract in details between our agents since I've nearly finished to code. By now I've define the following rules:

I defined that only is available between the instances of our agents can open only one "conversation channel" simultaneously (this is because your agent will negotiate with the user as far as I concerned, so you'll need a kind of GUI)..

Now some technical details:

I differ between the message by "Perfomatives" I call "ACLMessage.setPerformative" in order to define the message type Since I've defined my own constants for this purpose I suggest you to use them too:

public enum Resource implements Serializable {

}

The information is transfered via the serializable classes An ACLMessage.setContentObject allows to do that I've defined 2 classes by now that can contain an information:

   1 public class ResourceContent implements Serializable {
   2     private Resource resource;
   3 
   4     public ResourceContent(Resource resource) {
   5         this.resource = resource;
   6     }
   7 
   8     public Resource getResource() {
   9         return resource;
  10     }
  11 }

   1 /**
   2  *  Denotes resource and price content
   3  *  @author Mark Bramnik
   4  */
   5 public class ResourceForPriceContent  extends ResourceContent {
   6     private Integer price;
   7 
   8     public ResourceForPriceContent(Resource pResource, Integer pPrice) {
   9         super(pResource);
  10         this.price = pPrice;
  11     }
  12 
  13     public Integer getPrice() {
  14         return price;
  15     }
  16 }

Resource - is an enum ( I use jdk 6 from sun)

   1 public enum Resource implements Serializable {
   2     NETWORK,
   3     CPU,
   4     DISK,
   5     MEMORY
   6 }

Of course I'll provide a jar with these classes for reuse. Well, basically thats all, If you have a notes feel free to tell me I'll update the project

I've decided to identify each conversation by a randomly generated String key (I used java.utils.UUID class for that purpose). So when you receive from me a LACK_FOR_PRICE message call msg.getConversationId() to obtain the conversation key. Then add it to your message so that I'll be able to identify the conversation. Moreover, please supply a resource and price when needed.

I've finished the project refactoring so that it now can be run with ant script, all the directories also were moved to another locations You should add your project into analyzer/analyzer-src folder of the project (this will be your source-root package) Unless you don't define some external configuration files, the ant script should handle your sources.

Run ant compile to compile the project (monitor agent, analyzer agent, common - our common part) this should create "build" directory and place the *.class files into it

Run ant install to install the project This should pack the classes into jars, create "build/release" directory and put our jars to that dir.

Run ant run to run the project This should run the project :)

Run ant clean in order to remove the generated build directory


CategoryCourses

AI2Project (last edited 2007-12-24 16:47:45 by localhost)