|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ciagent.CIAgent | +--marketplace.SellerAgent
The SellerAgent
class implements a very simple seller agent.
Field Summary | |
protected BasicNegotiation |
current
|
protected long |
income
|
protected java.util.Vector |
inventory
|
protected BuySellMessage |
msg
|
protected java.util.Hashtable |
negotiations
|
Fields inherited from class ciagent.CIAgent |
agentPlatform,
children,
DEFAULT_ASYNCTIME,
DEFAULT_SLEEPTIME,
name,
parent,
traceLevel |
Constructor Summary | |
SellerAgent()
Creates a SellerAgent object. |
|
SellerAgent(java.lang.String name)
Creates a SellerAgent object with the given name. |
Method Summary | |
(package private) java.lang.String |
genId()
Generates a unique id for an item in inventory. |
java.lang.String |
getTaskDescription()
Retrieves the task description that indicates what this agent is doing. |
void |
initialize()
Registers with the facilitator, initalizes its inventory, and advertises the items it has for sale. |
(package private) boolean |
itemInInventory(java.lang.String item)
Checks if an item is in inventory |
(package private) void |
negotiate(Offer offer,
BuySellMessage msg)
Negotiates by accepting or rejecting offers. |
void |
process()
Does nothing. |
void |
processCIAgentEvent(CIAgentEvent e)
Processes a CIAgentEvent. |
void |
processMessage(BuySellMessage msg)
Processes the BuySellMessage received in a CIAgentEvent object. |
void |
processTimerPop()
Processes a timer pop by displaying a trace message. |
(package private) void |
rejectOffer(Offer offer)
Breaks off a negotiation (for whatever reason), returns the item to inventory, and removes the negotiation from the active list. |
(package private) BasicNegotiation |
removeItemFromInventory(java.lang.String item)
Removes an item from inventory. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected BuySellMessage msg
protected BasicNegotiation current
protected long income
protected java.util.Vector inventory
protected java.util.Hashtable negotiations
Constructor Detail |
public SellerAgent()
SellerAgent
object.public SellerAgent(java.lang.String name)
SellerAgent
object with the given name.name
- the String object that contains the name of the agentMethod Detail |
public java.lang.String getTaskDescription()
public void initialize()
public void process()
public void processTimerPop()
public void processCIAgentEvent(CIAgentEvent e)
e
- the CIAgentEvent object to be processedjava.lang.String genId()
public void processMessage(BuySellMessage msg)
msg
- the BuySellMessage object to be processedvoid negotiate(Offer offer, BuySellMessage msg)
offer
- the Offer object for the current offermsg
- the BuySellMessage objectvoid rejectOffer(Offer offer)
offer
- the Offer object that contains the offer being rejectedboolean itemInInventory(java.lang.String item)
item
- the String object that contains the item to be checkedBasicNegotiation removeItemFromInventory(java.lang.String item)
item
- the String object that contains the itme to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |