| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cuny.cat.stat.PayoffReport
public class PayoffReport
This class aims to support an ecological simulation of a set of specialists in an all-round cat game. It uses the past normalized payoffs of specialists to control how frequently (in terms of days) the same set of specialists participate in the game this time.
It reads in the past normalized payoffs from the last line of a .CSV file and uses the payoffs as probability thresholds to control whether a specialist should be banned to reflect restrict on its participation.
At the end of the game, game scores of specialists are normalized and appended to the the .CSV file as the latest payoffs.
In this way, one run of the cat game represents a simulation of one generation.
 TODO: note that the scores from ScoreReport is the cumulative score
 across games, not for the last game only. So temporarily, force it to reset
 scores when a new game starts.
 
| Field Summary | |
|---|---|
static char | 
DEFAULT_SEPARATOR
 | 
protected  java.lang.String | 
inputFileName
the name of the payoff file; if existing, contains previous normalized payoffs  | 
protected  java.lang.String | 
outputFileName
 | 
static java.lang.String | 
P_INPUTFILE
 | 
static java.lang.String | 
P_OUTPUTFILE
 | 
protected  edu.cuny.util.io.CSVWriter | 
writer
 | 
| Fields inherited from interface edu.cuny.cat.stat.GameReport | 
|---|
ACCEPTED, ASK, BID, CONVERGENCE_COEFFICIENT, EFFICIENCY, EQUILIBRIUM, FEE, Formatter, GLOBAL, MARKETSHARE, MAX, MEAN, MIN, PLACED, PRICE, PROFIT, PROFIT_DISPERSION, QUANTITY, SCORE, SHOUT, SPECIALIST, STDEV, TOTAL, TRADER, TRANSACTION, TRANSACTIONRATE, VALUE | 
| Constructor Summary | |
|---|---|
PayoffReport()
 | 
|
| Method Summary | |
|---|---|
protected  void | 
applyPossblePenalties()
apply probablistic day banning penalty to specialists that are supposed to have less presence in the game.  | 
protected  void | 
closeWriter()
 | 
 void | 
eventOccurred(AuctionEvent event)
 | 
protected  void | 
generateHeader()
TODO: writes the IDs of specialists and an initial even payoffs to the beginning of the payoff file.  | 
protected  double | 
getAbsolutePayoff(java.lang.String specialistId)
 | 
 java.util.Map<edu.cuny.stat.ReportVariable,?> | 
getVariables()
 | 
protected  boolean | 
initPreviousPayoffs()
reads in the previous payoffs of specialists.  | 
protected  void | 
initRandomGenerators()
 | 
protected  void | 
initScoreReport()
 | 
protected  void | 
initWriter()
 | 
 void | 
produceUserOutput()
 | 
protected  void | 
setPayoffs(java.util.List<java.lang.Double> payoffList)
initialize the probabilities of participation based on payoffs of the previous game.  | 
 void | 
setup(edu.cuny.config.param.ParameterDatabase parameters,
      edu.cuny.config.param.Parameter base)
 | 
 java.lang.String | 
toString()
 | 
protected  void | 
writePayoffs()
writes normalized payoffs of the ending game to payoff file.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String P_INPUTFILE
public static final java.lang.String P_OUTPUTFILE
public static final char DEFAULT_SEPARATOR
protected edu.cuny.util.io.CSVWriter writer
protected java.lang.String inputFileName
protected java.lang.String outputFileName
| Constructor Detail | 
|---|
public PayoffReport()
| Method Detail | 
|---|
public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
setup in interface edu.cuny.config.param.Parameterizableprotected void generateHeader()
protected void setPayoffs(java.util.List<java.lang.Double> payoffList)
payoffList - protected boolean initPreviousPayoffs()
protected void initWriter()
protected void closeWriter()
protected double getAbsolutePayoff(java.lang.String specialistId)
protected void writePayoffs()
protected void initScoreReport()
protected void initRandomGenerators()
protected void applyPossblePenalties()
public void eventOccurred(AuctionEvent event)
eventOccurred in interface AuctionEventListenerpublic void produceUserOutput()
produceUserOutput in interface edu.cuny.stat.Report<AuctionEvent>public java.util.Map<edu.cuny.stat.ReportVariable,?> getVariables()
public java.lang.String toString()
toString in class java.lang.Object
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||