University of Calgary
Rob Kremer
Individual Assignment 2: Knowledge Bases/Belief Bases



CPSC 662/568: Agent Communication
(Formerly CPSC 601.68/599.68)
Fall 2012

Department of Computer Science
Computer
Science

Note: This is an individual assignment. You may brainstorm with other students, but the bulk of the work and the bulk of the ideas must be your own. That entails that you may not share a drawing by copy-and-paste or by any other means. If you do work with other students (or anybody else) you must cite that collaboration explicitly in your submitted assignment. This is good practice in any circumstances. You can easily do such citations in code comments.
Fig. 1: lazy cat
Fig. 1: Lazy cat. This agent shares the attitude of my agent.

Your task is to build an agent to do an arithmetic task for my agent. My agent has in mind a set of numbers, and you are requested to inform my agent of either the sum (add) or product (multiply) of the numbers my agent has in mind. The problem is that while you know my agent wants you to inform me of the answer, my agent is very lazy (see Fig. 1). It is so lazy, it won't ask you to do it. Instead, your agent has to query my agent for the numbers, stored in my predicate number, and query the zero-ary operator predicates either sum or product. You can count on not both operator predicates being the same. Obviously, the predicate number may have zero, one, or more values. Should number have zero values, then return the identity of the operation (0 for product, 1 for sum). You should inform my agent of the result by sending it an inform message asserting the unique value of the result into it's belief base.

My agent will be listening at port 8999 (so you can use URL ":8999" to address it). Your agent should be named after you -- by your last name, and should have no package (default package). I will start your agent using the following line:

  (agent.start-agent "name" name port-number :process "CURRENT")

My agent will then wait around for 10 seconds or so, and then check its own belief base using (some ?x (result ?x)) which it expects will return (= a-result (some ?x (result ?x))) where a-result is the value expected according to the specifications above. You pass if your agent meets these expectations and you did not cheat in some way to do it. :) The more precise mark for the assignment will depend on your adherence to the methods taught in class and the elegance of your code and internal documentation.


What to hand in?

Simply send me (by email) your .java file, and any .lisp files named appropriately to go with your agent. Thus, I expect the following files, where each .lisp file is optional:

As in the previous assignment, you may discuss t


UofC
CPSC 662/568: Agent Communication
Department of Computer Science

Last updated 2012-10-01 17:33
Rob Kremer