marketplace
Class BestSellerAgent
java.lang.Object
|
+--ciagent.CIAgent
|
+--marketplace.SellerAgent
|
+--marketplace.BestSellerAgent
- public class BestSellerAgent
- extends SellerAgent
- implements Effector
The BestSellerAgent
class implements a buyer agent with the
best negotiating skills in the marketplace application.
- See Also:
- Serialized Form
Constructor Summary |
BestSellerAgent()
Creates a BestSellerAgent object. |
BestSellerAgent(java.lang.String name)
Creates a BestSellerAgent object with the given name. |
Method Summary |
long |
effector(java.lang.Object obj,
java.lang.String eName,
java.lang.String args)
Used by action rules in rule base to make or accept offers. |
void |
initBestSellerRuleBase()
Initializes the BestSeler rule base. |
void |
initialize()
Initializes the BestSeller rule base. |
(package private) void |
negotiate(Offer offer,
BuySellMessage msg)
Uses forward chaining and the rule base to determine whether to
accept or reject an 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
BestSellerAgent
public BestSellerAgent()
- Creates a
BestSellerAgent
object.
BestSellerAgent
public BestSellerAgent(java.lang.String name)
- Creates a
BestSellerAgent
object with the given name.
- Parameters:
name
- the String object that contains the name
initialize
public void initialize()
- Initializes the BestSeller rule base.
- Overrides:
- initialize in class SellerAgent
effector
public long effector(java.lang.Object obj,
java.lang.String eName,
java.lang.String args)
- Used by action rules in rule base to make or accept offers.
- Specified by:
- effector in interface Effector
- Parameters:
obj
- the Object object implementing the effectoreName
- the String object that contains the name of the effectorargs
- the String object that contains the arguments for the effector- Returns:
- the long object
negotiate
void negotiate(Offer offer,
BuySellMessage msg)
- Uses forward chaining and the rule base to determine whether to
accept or reject an offer.
- Parameters:
offer
- the Offer object that contains the current offermsg
- the BuySellMessage object- Overrides:
- negotiate in class SellerAgent
initBestSellerRuleBase
public void initBestSellerRuleBase()
- Initializes the BestSeler rule base.