marketplace
Class BestBuyerAgent
java.lang.Object
|
+--ciagent.CIAgent
|
+--marketplace.BuyerAgent
|
+--marketplace.BestBuyerAgent
- public class BestBuyerAgent
- extends BuyerAgent
- implements Effector
The BestBuyerAgent
class implements a buyer agent with the
best negotiating skills in the marketplace application.
- See Also:
- Serialized Form
Constructor Summary |
BestBuyerAgent()
Creates a BestBuyerAgent object. |
BestBuyerAgent(java.lang.String name)
Creates a BestBuyerAgent object with the given name. |
Method Summary |
long |
effector(java.lang.Object obj,
java.lang.String eName,
java.lang.String args)
Method effector used by action rules in rule base to make or accept offers |
void |
initBestBuyerRuleBase()
Initializes the BestBuyer rule base. |
void |
initialize()
Initializes the rule base for this buyer agent. |
(package private) void |
negotiate(Offer offer,
BuySellMessage msg)
Uses the rule base and forward chaining to decide whether to accept
an offer or make a counter offer. |
Methods inherited from class ciagent.CIAgent |
addAgent,
addCIAgentEventListener,
addPropertyChangeListener,
getAgent,
getAgentPlatform,
getAgents,
getAsyncTime,
getChildren,
getCustomizerClass,
getDisplayName,
getName,
getParent,
getSleepTime,
getState,
getTraceLevel,
notifyCIAgentEventListeners,
postCIAgentEvent,
processAsynchronousEvents,
removeAgent,
removeCIAgentEventListener,
removePropertyChangeListener,
reset,
resumeAgentProcessing,
setAgentPlatform,
setAsyncTime,
setName,
setParent,
setSleepTime,
setState,
setTraceLevel,
startAgentProcessing,
stopAgentProcessing,
suspendAgentProcessing,
trace |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
rb
protected BooleanRuleBase rb
offerDelta
protected RuleVariable offerDelta
spread
protected RuleVariable spread
firstOffer
protected RuleVariable firstOffer
offer
protected Offer offer
BestBuyerAgent
public BestBuyerAgent()
- Creates a
BestBuyerAgent
object.
BestBuyerAgent
public BestBuyerAgent(java.lang.String name)
- Creates a
BestBuyerAgent
object with the given name.
- Parameters:
name
- the String object that contains the name
initialize
public void initialize()
- Initializes the rule base for this buyer agent.
- Overrides:
- initialize in class BuyerAgent
effector
public long effector(java.lang.Object obj,
java.lang.String eName,
java.lang.String args)
- Method effector used by action rules in rule base to make or accept offers
- Specified by:
- effector in interface Effector
- Parameters:
obj
- the Object object that implements the effectoreName
- the String object that contains the effector nameargs
- the String object that contains the effector arguments- Returns:
- the long value that represents the status of the effector execution
negotiate
void negotiate(Offer offer,
BuySellMessage msg)
- Uses the rule base and forward chaining to decide whether to accept
an offer or make a counter offer.
- Parameters:
offer
- the Offer object that contains the current offermsg
- the BuySellMessage object- Overrides:
- negotiate in class BuyerAgent
initBestBuyerRuleBase
public void initBestBuyerRuleBase()
- Initializes the BestBuyer rule base.