net.sourceforge.jasa.report
Class DynamicConvergenceReport

java.lang.Object
  extended by net.sourceforge.jasa.report.AbstractAuctionReport
      extended by net.sourceforge.jasa.report.AbstractMarketStatsReport
          extended by net.sourceforge.jasa.report.DynamicConvergenceReport
All Implemented Interfaces:
java.io.Serializable, AuctionReport

public class DynamicConvergenceReport
extends AbstractMarketStatsReport

A historicalDataReport that keeps track of the convergence of transaction prices, computing the coefficient of convergence Vernon Smith used. The equilibrium price is recomputed at the end of each day, thus this class can be used to keep track of theoretically available surplus even when supply and demand are changing over time. Each agent is assumed to be hypothetically able to trade the specified quantity of units in each day.

See Also:
Serialized Form
 

Field Summary
protected  double alpha
           
protected  double devSquareSum
           
protected  EquilibriumReportVariables equilibriaStats
          The historicalDataReport used to calculate the equilibrium price.
protected  double equilibriumPrice
           
static java.lang.String P_DEF_BASE
           
static java.lang.String P_QUANTITY
           
protected  int quantity
          The quantity that each agent can theoretically trade per day.
static ReportVariable VAR_ALPHA
           
 
Fields inherited from class net.sourceforge.jasa.report.AbstractAuctionReport
auction
 
Constructor Summary
DynamicConvergenceReport()
           
 
Method Summary
 void calculate()
          Perform final calculations at the end of the market.
protected  void compute(SimEvent event)
           
 double getAlpha()
           
 int getQuantity()
           
 java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
           
 void initialise()
           
protected  void newPrice(double price)
           
 void produceUserOutput()
           
 void reset()
           
 void setAuction(Market auction)
           
 void setQuantity(int quantity)
           
 
Methods inherited from class net.sourceforge.jasa.report.AbstractMarketStatsReport
eventOccurred
 
Methods inherited from class net.sourceforge.jasa.report.AbstractAuctionReport
getAuction, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

equilibriaStats

protected EquilibriumReportVariables equilibriaStats
The historicalDataReport used to calculate the equilibrium price.


quantity

protected int quantity
The quantity that each agent can theoretically trade per day. This should normally be set equal to agents' trade entitlement.


alpha

protected double alpha

equilibriumPrice

protected double equilibriumPrice

devSquareSum

protected double devSquareSum

P_DEF_BASE

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

P_QUANTITY

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

VAR_ALPHA

public static final ReportVariable VAR_ALPHA
Constructor Detail

DynamicConvergenceReport

public DynamicConvergenceReport()
Method Detail

setAuction

public void setAuction(Market auction)
Overrides:
setAuction in class AbstractAuctionReport

calculate

public void calculate()
Description copied from class: AbstractMarketStatsReport
Perform final calculations at the end of the market.

Specified by:
calculate in class AbstractMarketStatsReport

getAlpha

public double getAlpha()

compute

protected void compute(SimEvent event)

newPrice

protected void newPrice(double price)

initialise

public void initialise()

reset

public void reset()

produceUserOutput

public void produceUserOutput()
Overrides:
produceUserOutput in class AbstractAuctionReport

getVariableBindings

public java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
Overrides:
getVariableBindings in class AbstractAuctionReport

getQuantity

public int getQuantity()

setQuantity

public void setQuantity(int quantity)