net.commerce.zocalo.experiment.role
Class Trader

java.lang.Object
  extended by net.commerce.zocalo.experiment.role.AbstractSubject
      extended by net.commerce.zocalo.experiment.role.TradingSubject
          extended by net.commerce.zocalo.experiment.role.Trader
All Implemented Interfaces:
ExperimentSubject
Direct Known Subclasses:
Borrower

public class Trader
extends TradingSubject

Traders exchange goods in the market.


Field Summary
 
Fields inherited from class net.commerce.zocalo.experiment.role.TradingSubject
AssetsComponent, AverageComponent, BalanceComponent, PrivateDividendComponent, PublicDividendComponent, role, TotalDividendComponent
 
Fields inherited from class net.commerce.zocalo.experiment.role.AbstractSubject
BonusComponent, MultiplierComponent, ScoreComponent, scoreExplanation
 
Constructor Summary
protected Trader(User user, Role role)
           
 
Method Summary
static Trader makeTrader(User user, Role role)
           
 java.lang.String propertyWordForRole()
           
 Quantity recordBonusInfo(Price average, Quantity judged, Quantity actual, Quantity totalDividend, int round, java.util.Properties props)
           
 void recordDormantInfo(Quantity judged, java.lang.String outcome, java.util.Properties props)
           
 void recordExplanation(java.util.Properties props, boolean keepingScore, boolean carryForward, java.lang.String eventOutcome)
           
 void recordScore(int currentRound, Quantity multiplier, java.util.Properties props)
           
protected  java.lang.String traderEarningsLabel(java.util.Properties props)
           
protected  java.lang.String traderInvestmentLabel(java.util.Properties props)
           
 
Methods inherited from class net.commerce.zocalo.experiment.role.TradingSubject
accountValueFromProperties, addBonus, assetValueTable, balance, canBuy, canSell, cashFromProperties, couponValue, currentCouponCount, displayCarryForwardScores, dormant, getHint, getName, getUser, limitedCouponValue, linkText, logConfigValues, pageLink, payDividend, publicValueLabel, receiveDividend, recordActualValueExplanations, reduceReservesTo, rememberAssets, rememberHoldings, resetOutstandingOrders, roleName, setHint, totalDividend
 
Methods inherited from class net.commerce.zocalo.experiment.role.AbstractSubject
actualValueLabel, addScoreComponent, dividendValueLabel, dormantPeriods, getScore, getScoreComponent, getScoreComponent, getScoreExplanation, getScoreLogger, initializeDormancy, isDormant, labelFromPropertyOrDefault, linkHtml, recordMultiplier, resetScoreInfo, saveMultiplierIfGiven, setHintsForRound, setScore, totalAssetsLabel, totalScore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trader

protected Trader(User user,
                 Role role)
Method Detail

propertyWordForRole

public java.lang.String propertyWordForRole()
Specified by:
propertyWordForRole in class TradingSubject

recordBonusInfo

public Quantity recordBonusInfo(Price average,
                                Quantity judged,
                                Quantity actual,
                                Quantity totalDividend,
                                int round,
                                java.util.Properties props)
Specified by:
recordBonusInfo in class AbstractSubject

recordScore

public void recordScore(int currentRound,
                        Quantity multiplier,
                        java.util.Properties props)
Specified by:
recordScore in class AbstractSubject

recordExplanation

public void recordExplanation(java.util.Properties props,
                              boolean keepingScore,
                              boolean carryForward,
                              java.lang.String eventOutcome)
Specified by:
recordExplanation in class AbstractSubject

recordDormantInfo

public void recordDormantInfo(Quantity judged,
                              java.lang.String outcome,
                              java.util.Properties props)
Specified by:
recordDormantInfo in class AbstractSubject

traderEarningsLabel

protected java.lang.String traderEarningsLabel(java.util.Properties props)

traderInvestmentLabel

protected java.lang.String traderInvestmentLabel(java.util.Properties props)

makeTrader

public static Trader makeTrader(User user,
                                Role role)