| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
edu.cuny.cat.trader.AbstractTradingAgent
public abstract class AbstractTradingAgent
An abstract implementation of trading agents that can bid in a market and can choose between markets to maximize their profit.
| Field Summary | |
|---|---|
protected  java.util.Map<java.lang.String,Specialist> | 
availableMarkets
 | 
protected  Shout | 
currentShout
The current shout for this trader.  | 
protected  double | 
informationFee
 | 
protected  boolean | 
isSeller
Flag indicating whether this trader is a seller or buyer.  | 
protected  double | 
lastDayProfit
The profit made in the last day.  | 
protected  double | 
lastShoutProfit
The profit made in the last accepted shout.  | 
protected  AbstractMarketSelectionStrategy | 
marketSelectionStrategy
 | 
static java.lang.String | 
P_DEF_BASE
Parameter names used when initialising from parameter db  | 
static java.lang.String | 
P_INITIAL_MARGIN
 | 
static java.lang.String | 
P_IS_SELLER
 | 
static java.lang.String | 
P_MARKET_SELECTION_STRATEGY
 | 
static java.lang.String | 
P_RESETTING_CONDITION
 | 
static java.lang.String | 
P_STRATEGY
 | 
protected  double | 
privateValue
 | 
protected  double | 
profitFee
 | 
protected  double | 
profits
The total cumulativeProfits to date  | 
protected  double | 
registrationFee
 | 
protected  ResettingCondition | 
resettingCondition
 | 
protected  double | 
shoutFee
 | 
protected  java.util.Set<java.lang.String> | 
shoutIdList
 | 
protected  AbstractStrategy | 
strategy
The bidding strategy for this trader.  | 
protected  java.lang.String | 
traderId
 | 
protected  double | 
transactionFee
 | 
| Constructor Summary | |
|---|---|
AbstractTradingAgent()
 | 
|
AbstractTradingAgent(double privateValue,
                     boolean isSeller)
 | 
|
AbstractTradingAgent(double privateValue,
                     boolean isSeller,
                     AbstractStrategy strategy)
 | 
|
| Methods inherited from class java.util.Observable | 
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface edu.cuny.obj.Prototypeable | 
|---|
protoClone | 
| Field Detail | 
|---|
protected double privateValue
protected boolean isSeller
protected AbstractStrategy strategy
protected AbstractMarketSelectionStrategy marketSelectionStrategy
protected ResettingCondition resettingCondition
protected double lastShoutProfit
protected double lastDayProfit
protected double profits
protected Shout currentShout
protected java.lang.String traderId
protected java.util.Map<java.lang.String,Specialist> availableMarkets
protected java.util.Set<java.lang.String> shoutIdList
protected double registrationFee
protected double informationFee
protected double shoutFee
protected double transactionFee
protected double profitFee
public static final java.lang.String P_DEF_BASE
public static final java.lang.String P_IS_SELLER
public static final java.lang.String P_STRATEGY
public static final java.lang.String P_INITIAL_MARGIN
public static final java.lang.String P_MARKET_SELECTION_STRATEGY
public static final java.lang.String P_RESETTING_CONDITION
| Constructor Detail | 
|---|
public AbstractTradingAgent()
public AbstractTradingAgent(double privateValue,
                            boolean isSeller)
public AbstractTradingAgent(double privateValue,
                            boolean isSeller,
                            AbstractStrategy strategy)
| Method Detail | 
|---|
public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
setup in interface edu.cuny.config.param.Parameterizablepublic void initialize()
public void reset()
reset in interface edu.cuny.obj.Resetable
public void shoutAccepted(Shout shout,
                          double price,
                          int quantity)
public void requestShout()
public void eventOccurred(AuctionEvent event)
eventOccurred in interface AuctionEventListenerprotected void processIdAssigned(IdAssignedEvent event)
public void processFeesAnnounced(FeesAnnouncedEvent event)
public void processRegistration(RegistrationEvent event)
public void processGameStarting(GameStartingEvent event)
public void processGameStarted(GameStartedEvent event)
public void processGameOver(GameOverEvent event)
public void processRoundOpened(RoundOpenedEvent event)
protected void processRoundClosing(RoundClosingEvent event)
public void processRoundClosed(RoundClosedEvent event)
public void processDayClosed(DayClosedEvent event)
public void processDayOpened(DayOpenedEvent event)
public void processPrivateValueAssigned(PrivateValueAssignedEvent event)
public void processTransactionExecuted(TransactionExecutedEvent event)
public void processSubscription(SubscriptionEvent event)
public void processShoutPlaced(ShoutPlacedEvent event)
public java.lang.String getTraderId()
public void setPrivateValue(double privateValue)
public double getPrivateValue()
public Shout getCurrentShout()
public void setIsSeller(boolean isSeller)
public boolean isSeller()
public boolean isBuyer()
public void setTraderId(java.lang.String traderId)
public void setStrategy(AbstractStrategy strategy)
public AbstractStrategy getStrategy()
public void setMarketSelectionStrategy(AbstractMarketSelectionStrategy marketSelectionStrategy)
public AbstractMarketSelectionStrategy getMarketSelectionStrategy()
public double getProfits()
public void setProfits(double profits)
public double getLastDayProfit()
public void setLastDayProfit(double lastDayProfit)
public double getLastShoutProfit()
public void setLastShoutProfit(double lastShoutProfit)
public abstract boolean isActive()
public void update(java.util.Observable o,
                   java.lang.Object arg)
update in interface java.util.Observer
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||