net.commerce.zocalo.experiment.role
Class Manipulator

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.Manipulator
All Implemented Interfaces:
ExperimentSubject

public class Manipulator
extends TradingSubject

Manipulators have special rules for calculating their score.


Field Summary
static java.lang.Object BonusComponent
           
static java.lang.Object ConstantComponent
           
static java.lang.String DIFFERENCE_TOKEN
           
static java.lang.Object DividendComponent
           
static java.lang.Object FactorComponent
           
static java.lang.Object JudgedComponent
           
static java.lang.String MANIPULATOR_REWARDS_TOKEN
           
static java.lang.Object PlusBonusComponent
           
static java.lang.Object TargetComponent
           
 
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
MultiplierComponent, ScoreComponent, scoreExplanation
 
Method Summary
 java.lang.String logConfigValues(org.apache.log4j.Logger log, java.util.Properties props, int rounds)
           
static Manipulator makeManipulator(User user, ManipulatorRole role)
           
 java.lang.String propertyWordForRole()
           
 Quantity recordBonusInfo(Price average, Quantity judged, Quantity judgingTarget, 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)
           
 java.lang.String roleName()
           
 void setHintsForRound(int currentRound, Session session)
           
 
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, pageLink, payDividend, publicValueLabel, receiveDividend, recordActualValueExplanations, reduceReservesTo, rememberAssets, rememberHoldings, resetOutstandingOrders, 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, setScore, totalAssetsLabel, totalScore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BonusComponent

public static final java.lang.Object BonusComponent

DividendComponent

public static final java.lang.Object DividendComponent

TargetComponent

public static final java.lang.Object TargetComponent

FactorComponent

public static final java.lang.Object FactorComponent

ConstantComponent

public static final java.lang.Object ConstantComponent

JudgedComponent

public static final java.lang.Object JudgedComponent

PlusBonusComponent

public static final java.lang.Object PlusBonusComponent

MANIPULATOR_REWARDS_TOKEN

public static final java.lang.String MANIPULATOR_REWARDS_TOKEN
See Also:
Constant Field Values

DIFFERENCE_TOKEN

public static final java.lang.String DIFFERENCE_TOKEN
See Also:
Constant Field Values
Method Detail

makeManipulator

public static Manipulator makeManipulator(User user,
                                          ManipulatorRole role)

propertyWordForRole

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

recordBonusInfo

public Quantity recordBonusInfo(Price average,
                                Quantity judged,
                                Quantity judgingTarget,
                                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

logConfigValues

public java.lang.String logConfigValues(org.apache.log4j.Logger log,
                                        java.util.Properties props,
                                        int rounds)
Specified by:
logConfigValues in interface ExperimentSubject
Overrides:
logConfigValues in class TradingSubject

setHintsForRound

public void setHintsForRound(int currentRound,
                             Session session)
Specified by:
setHintsForRound in interface ExperimentSubject
Overrides:
setHintsForRound in class AbstractSubject

roleName

public java.lang.String roleName()
Overrides:
roleName in class TradingSubject