uk.ac.liv.auction.stats
Class PayoffReport

java.lang.Object
  extended byuk.ac.liv.auction.stats.AbstractAuctionReport
      extended byuk.ac.liv.auction.stats.AbstractMarketStatsReport
          extended byuk.ac.liv.auction.stats.DynamicSurplusReport
              extended byuk.ac.liv.auction.stats.PayoffReport
All Implemented Interfaces:
AuctionEventListener, AuctionReport, Parameterizable, Resetable, java.io.Serializable
Direct Known Subclasses:
GroupPayoffReport, StrategyPayoffReport

public abstract class PayoffReport
extends DynamicSurplusReport
implements java.io.Serializable

An abstract report that keeps track of the ratio of actual verses theoretical profits for a particular grouping of agents. Concrete implementations define

Version:
$Revision: 1.4 $
Author:
Steve Phelps
See Also:
Serialized Form

Field Summary
protected  double totalProfits
           
 
Fields inherited from class uk.ac.liv.auction.stats.DynamicSurplusReport
equilibriaStats, P_QUANTITY, quantity
 
Fields inherited from class uk.ac.liv.auction.stats.AbstractAuctionReport
auction
 
Constructor Summary
PayoffReport()
           
 
Method Summary
 void calculate()
           
protected  void calculatePayoffs()
           
abstract  java.lang.Object getKey(AbstractTradingAgent agent)
          Map an agent onto a group.
abstract  java.lang.String getKeyName()
          Return user-friendly description of the space of groups.
 int getNumberOfAgents(java.lang.Object key)
           
 double getPayoff(java.lang.Object key)
           
 double getProfits(java.lang.Object key)
           
abstract  java.lang.String getReportText()
           
 double getTotalProfits()
           
 java.util.Map getVariables()
          Returns a Map of all of the variables that are produced in the report.
 void initialise()
           
 void produceUserOutput()
          Produce the final report for the user.
 void setup(ec.util.ParameterDatabase parameters, ec.util.Parameter base)
          Initialise this object from a parameter database.
 
Methods inherited from class uk.ac.liv.auction.stats.DynamicSurplusReport
calculateTotalEquilibriumSurplus, equilibriumSurplus, eventOccurred, getEquilibriumProfits, getQuantity, recalculate, reset, setAuction, setQuantity, updateStats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalProfits

protected double totalProfits
Constructor Detail

PayoffReport

public PayoffReport()
Method Detail

setup

public void setup(ec.util.ParameterDatabase parameters,
                  ec.util.Parameter base)
Description copied from interface: Parameterizable
Initialise this object from a parameter database.

Specified by:
setup in interface Parameterizable
Overrides:
setup in class DynamicSurplusReport

calculate

public void calculate()
Overrides:
calculate in class DynamicSurplusReport

calculatePayoffs

protected void calculatePayoffs()

getTotalProfits

public double getTotalProfits()

getProfits

public double getProfits(java.lang.Object key)

getPayoff

public double getPayoff(java.lang.Object key)

getNumberOfAgents

public int getNumberOfAgents(java.lang.Object key)

produceUserOutput

public void produceUserOutput()
Description copied from interface: AuctionReport
Produce the final report for the user. Implementors can do whatever they see fit, for example by writing a report on stdout, or they may choose to do nothing.

Specified by:
produceUserOutput in interface AuctionReport
Overrides:
produceUserOutput in class DynamicSurplusReport

getVariables

public java.util.Map getVariables()
Description copied from interface: AuctionReport
Returns a Map of all of the variables that are produced in the report. The Map maps variables, represented by objects of type ReportVariable, onto values, which may be of any class. If no variables are produced by this report then an empty Map is returned.

Specified by:
getVariables in interface AuctionReport
Overrides:
getVariables in class DynamicSurplusReport

initialise

public void initialise()
Overrides:
initialise in class DynamicSurplusReport

getKey

public abstract java.lang.Object getKey(AbstractTradingAgent agent)
Map an agent onto a group.

Parameters:
agent - The agent to map from.
Returns:
An object representing the grouping of this agent.

getKeyName

public abstract java.lang.String getKeyName()
Return user-friendly description of the space of groups.

Returns:
A string describing the grouping of this report.

getReportText

public abstract java.lang.String getReportText()