Dustin Stevens-Baier
Comp 575
Assignment #4



First off we need to discuss what fixes where needed in order to get the program up and running.  The first one was a previously mentioned changing of the enum keyword to enumOne in all files.  There was also a loop that happened so the following correction was made to the FacilitatorAgent, BuyerAgent and SellerAgent classes.

This:   if (traceLevel > 0)

was changed to: 

if (traceLevel > 0) {

            if ((action != null) && (!action.equals(�trace�)))

This made sure that no loop was enetered.  There was also an issue of deadlocks that were dealt with by changing the trace and the traceFacilitator methods.  These were changed to the following.

void trace(String msg) {

    traceTextArea.append(msg);

    //traceTextArea.setCaretPosition(traceTextArea.getText().length());

  }



void traceFacilitator(String msg) {

    topTextArea.append(msg);

    //topTextArea.setCaretPosition(topTextArea.getText().length());

 

  }





The initial App looks like this.  The point of this agent is to be both a buyer and a seller.  There are three agents in this package, the Buyer, Seller, and Facilitator. The major agent is the facilitator agent which does the monitoring of the buyer and seller agents.  The facilitator advertises, unadvertises, and reccomends the agents to each other. 
























The buyer agent is accessed by selecting the basic, intermediate, advanced option under the drop down menu in the marketplace gui.  The buyer has a couple of options that it does it first looks for an item  if it gets a tell then it makes an ask to the seller with an offer.  If the seller denys then it adds the item back to its list so that it can look again for an item.  Lastly, it either accepts the counter offer, makes another counter or rejects.


























The seller agent is accessed by selecting the basic, intermediate, advanced option under the drop down menu in the marketplace gui.  The seller agent first checks to see if teh object is in its inventory and then it either rejects if it is not or counter offers if it is. Then it either gets a tell return which means the buyer accepts its ocunter offer or it gets a make offer which is a counter offer.


























To start the buyer/seller process one goes to the file menu and selects start in the drop down menu.  The buyer and seller agents can increase in skill to intermediate and advanced.  The intermediate agent just makes an initial counter offer that is lower than the regular agent.  The best agent actually uses a variable that fluctuates while making offers, this has an end loop that rejects the offer after ten tries, thus keeping an endless loop from happening. This means that when one of them is running and not the other then either the seller or the buyer will get the better deal. 

Buyer & Seller

Guitar: 175
Drums: 300
Car: 175
--------------
Total:   650

Buyer & Better Seller

Guitar: 175
Drums: 300
Car: 175
--------------
Total:   650

 Buyer & Best Seller

Guitar: 200
Drums: 325
Car: 200
--------------
Total:   725


Better Buyer & Seller

Guitar: 150
Drums: 275
Car: 150
--------------
Total:   575

Better Buyer & Better Seller

Guitar: 150
Drums: 275
Car: 150
--------------
Total:   575


Better Buyer & Best Seller

Guitar: 150
Drums: 275
Car: 150
--------------
Total:   575


Best Buyer & Seller

Guitar: 125
Drums: 250
Car: 125
--------------
Total:   500

Best Buyer & Better Seller

Guitar: 125
Drums: 250
Car: 125
--------------
Total:   500

Best Buyer & Best Seller

Guitar: 115
Drums: 240
Car: 115
--------------
Total:   470

























Once started the gui looks like this.  You can see the facilitator adds the seller to the guitar, drums, or whatever you want to add.  I chanegd the second guitar to car so that the seler would sell three seperate items and make it easier to see the different items.  One can see the car option now takes the place of the old guitar option.



















































In this example the seller and buyer agree on a price of 175 for the guitar, so this makes the total 650 for all three items.  You can also see in this snapshot how the facilitator communicates between the two agents.  The buyer asks for a message then the seller makes an offer and the buyer counters.  Then the seller accepts and the buyer accepts, so the seller removes from the community of the guitar and makes the item unavailable. 



























In conclusion I found that the agents worked in a suprising way.  There wasn't any difference when the seller agent was an intermediate agent or regular against the regular buyer.  One would think that there should be a counter for the intermediate when both are intermediate but the buyer actually gets the better of the seller.  The buyer agent seems to affect the outcome more than the seller agent.  The best thing about this program is that it shows that agents can communicate and negotiate following a set of rules established before hand. 
Hosted by www.Geocities.ws

1