net.commerce.zocalo.experiment
Class LendingSession

java.lang.Object
  extended by net.commerce.zocalo.experiment.Session
      extended by net.commerce.zocalo.experiment.LendingSession

public class LendingSession
extends Session

Session for experiments in which we lend to subjects based Mark-to-market valuations.


Field Summary
 
Fields inherited from class net.commerce.zocalo.experiment.Session
chartScale, END_SCORING_TRANSITION, END_TRADING_TRANSITION, majorUnit, minorUnit, props
 
Constructor Summary
LendingSession(java.util.Properties props, org.mortbay.cometd.AbstractBayeux bayeux)
           
LendingSession(java.util.Properties props, java.lang.String logFile, org.mortbay.cometd.AbstractBayeux bayeux)
           
 
Method Summary
 Quantity availableLoan(Borrower borrower)
           
protected  TraderRole basicRoleForSession(java.lang.String role)
           
protected  void calculateScores(Price average)
           
static boolean describesM2MSession(java.util.Properties props)
           
 Quantity getCouponBasis()
           
 void increaseLending(Borrower b, Quantity amount)
           
 Quantity lendingRatio()
           
protected  void logSessionInitialization()
           
 void setPeriod(int mSecs)
           
 void webAction(java.lang.String userName, java.lang.String parameter)
           
 
Methods inherited from class net.commerce.zocalo.experiment.Session
aboveThresholdMessage, accrueDividendsAndBonuses, appendToErrorMessage, belowThresholdMessage, bookFundingRequired, buildDormantArray, calculateEarnings, calculateScores, cannotStartRoundMessage, closeSessionAppenders, endowedRoles, endSession, endTrading, endTradingLabel, eventOutcome, experimenterButtons, findSessionReplaceRoundString, getChartScale, getClaim, getCommonMessageLabel, getCurrentRound, getDividend, getDividend, getEarningsHint, getErrorMessage, getLogoPath, getMajorUnit, getMarket, getMessageLabel, getMinorUnit, getPayDividend, getPhase, getPlayer, getPriceHint, getPrivateDividend, getRemainingDividend, getRoundLabel, getRoundLabelOrDefault, getShareLimit, getSharesLabel, getShowEarnings, getTradeHistory, getTrader, getTraders, getUserOrNull, ifScoring, ifTrading, initializeRoles, initialTraderTickets, isCarryForward, lastRound, lastTradeValue, logCommonMessages, logEvent, logFileLinks, logParameterCombinations, logTransitionEvent, make, marketIsActive, marketPrice, maxPrice, message, message, playerNameIterator, playerNameSortedIterator, privateDividendsInUse, provideCash, recordScoreExplanation, renderScore, replaceRoundString, reservesAreRequired, rounds, sessionEndTradingAdaptor, sessionLogger, setPhase, showEarningsSummary, startNextRound, startNextRound, startNextTimedRound, startRoundActionLabel, startRoundText, startRoundTransitionLabel, startSession, startSession, stateSpecificDisplay, stateSpecificTraderButtons, stateSpecificTraderHtml, stopRoundActionLabel, timeLimit, timeRemaining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LendingSession

public LendingSession(java.util.Properties props,
                      org.mortbay.cometd.AbstractBayeux bayeux)

LendingSession

public LendingSession(java.util.Properties props,
                      java.lang.String logFile,
                      org.mortbay.cometd.AbstractBayeux bayeux)
Method Detail

describesM2MSession

public static boolean describesM2MSession(java.util.Properties props)

basicRoleForSession

protected TraderRole basicRoleForSession(java.lang.String role)
Overrides:
basicRoleForSession in class Session

webAction

public void webAction(java.lang.String userName,
                      java.lang.String parameter)
Overrides:
webAction in class Session

logSessionInitialization

protected void logSessionInitialization()
Overrides:
logSessionInitialization in class Session

lendingRatio

public Quantity lendingRatio()

setPeriod

public void setPeriod(int mSecs)

availableLoan

public Quantity availableLoan(Borrower borrower)

calculateScores

protected void calculateScores(Price average)
                        throws ScoreException
Overrides:
calculateScores in class Session
Throws:
ScoreException

increaseLending

public void increaseLending(Borrower b,
                            Quantity amount)

getCouponBasis

public Quantity getCouponBasis()