net.commerce.zocalo.experiment.role
Class Judge

java.lang.Object
  extended by net.commerce.zocalo.experiment.role.AbstractSubject
      extended by net.commerce.zocalo.experiment.role.Judge
All Implemented Interfaces:
ExperimentSubject

public class Judge
extends AbstractSubject

Judge calculates scores for experiment participants playing this role. Judges don't trade, so they have no User object. They don't actually participate in the market, but they are part of the market.


Field Summary
 
Fields inherited from class net.commerce.zocalo.experiment.role.AbstractSubject
BonusComponent, MultiplierComponent, ScoreComponent, scoreExplanation
 
Method Summary
 Quantity accountValueFromProperties(java.util.Properties props)
           
 void addBonus(Funds funds)
           
 boolean canBuy(int currentRound)
           
 void cancelCutOffTimer()
           
 boolean canSell(int currentRound)
           
 Quantity cashFromProperties(java.util.Properties props)
           
 Quantity currentCouponCount(BinaryClaim claim)
           
 java.lang.String estimateAsString(int round)
           
 java.util.TimerTask getCutoffTimer()
           
 Price getEstimate(int round)
           
 void getGuessesRow(java.lang.StringBuffer buf, Session session)
           
 java.lang.String getHint()
           
 java.lang.String getName()
           
 java.lang.String getWarningsHtml()
           
 boolean hasWarnings()
           
static IndividualTimingEvent judgeTimingEvent(Judge judge)
           
 boolean judgingCutoff()
           
protected  java.lang.String linkText()
           
static Judge makeJudge(int rounds)
           
 java.lang.String pageLink()
           
 Funds payDividend(Quantity perShareDividend, Quantity shares, Position noPosition)
           
 void receiveDividend(Funds funds)
           
 Quantity recordBonusInfo(Price average, Quantity judged, Quantity target, 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)
           
 void reduceReservesTo(Quantity perShare, Position pos)
           
 void resetOutstandingOrders()
           
 java.lang.String roleName()
           
 void setEstimate(int round, Price estimate)
           
 void setHint(java.lang.String hint)
           
 void setName(java.lang.String name)
           
static IndividualTimingEvent timerEvent(Judge judge, org.apache.log4j.Logger logger)
           
 Quantity totalDividend(BinaryClaim claim, Session session, int round)
           
 void warn(java.lang.String s)
           
 
Methods inherited from class net.commerce.zocalo.experiment.role.AbstractSubject
actualValueLabel, addScoreComponent, dividendValueLabel, dormant, dormantPeriods, getScore, getScoreComponent, getScoreComponent, getScoreExplanation, getScoreLogger, initializeDormancy, isDormant, labelFromPropertyOrDefault, linkHtml, logConfigValues, recordMultiplier, rememberAssets, rememberHoldings, resetScoreInfo, saveMultiplierIfGiven, setHintsForRound, setScore, totalAssetsLabel, totalScore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeJudge

public static Judge makeJudge(int rounds)

accountValueFromProperties

public Quantity accountValueFromProperties(java.util.Properties props)

cashFromProperties

public Quantity cashFromProperties(java.util.Properties props)

currentCouponCount

public Quantity currentCouponCount(BinaryClaim claim)

resetOutstandingOrders

public void resetOutstandingOrders()

setEstimate

public void setEstimate(int round,
                        Price estimate)

judgingCutoff

public boolean judgingCutoff()

warn

public void warn(java.lang.String s)

hasWarnings

public boolean hasWarnings()

getWarningsHtml

public java.lang.String getWarningsHtml()

getEstimate

public Price getEstimate(int round)

linkText

protected java.lang.String linkText()
Specified by:
linkText in class AbstractSubject

pageLink

public java.lang.String pageLink()

recordBonusInfo

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

addBonus

public void addBonus(Funds funds)
Specified by:
addBonus in class AbstractSubject

payDividend

public Funds payDividend(Quantity perShareDividend,
                         Quantity shares,
                         Position noPosition)
Specified by:
payDividend in class AbstractSubject

receiveDividend

public void receiveDividend(Funds funds)
Specified by:
receiveDividend in class AbstractSubject

reduceReservesTo

public void reduceReservesTo(Quantity perShare,
                             Position pos)
Specified by:
reduceReservesTo in class AbstractSubject

recordDormantInfo

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

totalDividend

public Quantity totalDividend(BinaryClaim claim,
                              Session session,
                              int round)
Specified by:
totalDividend 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

canSell

public boolean canSell(int currentRound)

canBuy

public boolean canBuy(int currentRound)

roleName

public java.lang.String roleName()
Specified by:
roleName in class AbstractSubject

getHint

public java.lang.String getHint()

setHint

public void setHint(java.lang.String hint)

getName

public java.lang.String getName()
Specified by:
getName in class AbstractSubject

setName

public void setName(java.lang.String name)

estimateAsString

public java.lang.String estimateAsString(int round)

getGuessesRow

public void getGuessesRow(java.lang.StringBuffer buf,
                          Session session)

getCutoffTimer

public java.util.TimerTask getCutoffTimer()

timerEvent

public static IndividualTimingEvent timerEvent(Judge judge,
                                               org.apache.log4j.Logger logger)

judgeTimingEvent

public static IndividualTimingEvent judgeTimingEvent(Judge judge)

cancelCutOffTimer

public void cancelCutOffTimer()