agentland.drug
Interface DrugLord

All Known Implementing Classes:
DrugLordAgent, DrugLordEHA

public interface DrugLord
extends Agent


Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Method Summary
 void changeTupleSet(DrugRequest request, Vector tuples)
          This lets dealers change the vector of tuples that might satisfy him.
 void changeUrg(DrugRequest request, Urgency urg)
          This lets dealers change the urgency with which they have requested some tuple.
 Tuple requestHit(Vector tuples, DrugRequest request)
          This is the most important part of our job.
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 

Method Detail

requestHit

public Tuple requestHit(Vector tuples,
                        DrugRequest request)
                 throws RemoteException
This is the most important part of our job. A dealer gives us a vector of tuples of drugs that would might satisfy him, and a drug request object that indicates the agentID of the addict and the general urgency that the request is being made at. We do some parsing, think about everything for a bit, and then pass back the tuple he can use (possibly null).

changeUrg

public void changeUrg(DrugRequest request,
                      Urgency urg)
               throws RemoteException
This lets dealers change the urgency with which they have requested some tuple. They can raise or lower it to indicate a change in urgency, or set it to Urgency.NONE to indicate they are done with their drug. Note that the request passed in should be the _old_ request, with the urgency not yet updated.

changeTupleSet

public void changeTupleSet(DrugRequest request,
                           Vector tuples)
                    throws RemoteException
This lets dealers change the vector of tuples that might satisfy him. He passes in the request he's changing, and the new vector of tuples.