agentland.drug
Class DrugLordAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.drug.DrugLordAgent
- public class DrugLordAgent
- extends AgentAgent
- implements DrugLord
- See Also:
- Serialized Form
Methods inherited from class metaglue.AgentAgent |
addMonitor,
alive,
defrost,
defrostAll,
defrostBoolean,
defrostInt,
defrostString,
fixAttribute,
fixAttribute,
freeze,
freeze,
freeze,
freezeAll,
freezeVar,
getAgentID,
getAttribute,
getCatalog,
getCatalogID,
getDesignation,
getFrozenVariables,
getLogLevel,
getMetaglueAgent,
getMetaglueAgentID,
getOccupation,
getProperties,
getSociety,
log,
log,
log,
obtainMetaglueAgent,
obtainMetaglueAgent,
obtainMetaglueAgentByName,
reliesOn,
reliesOn,
reliesOn,
reliesOnSynch,
removeFrozen,
replaceExceptionHandler,
setFreezeName,
setLogLevel,
setLogName,
shutdown,
startAgent,
startAgentOn,
startAgentOn,
startup,
status,
tiedTo,
tiedTo,
tiedTo,
tiedTo,
tieToDesignation,
whereAreYou |
DrugLordAgent
public DrugLordAgent()
throws RemoteException
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).
- Specified by:
- requestHit in interface DrugLord
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.
- Specified by:
- changeUrg in interface DrugLord
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.
- Specified by:
- changeTupleSet in interface DrugLord