uk.ac.liv.auction.stats
Class HistoricalDataReport
java.lang.Object
uk.ac.liv.auction.stats.AbstractAuctionReport
uk.ac.liv.auction.stats.HistoricalDataReport
- All Implemented Interfaces:
- AuctionEventListener, AuctionReport, Parameterizable, Resetable, java.io.Serializable
- public class HistoricalDataReport
- extends AbstractAuctionReport
- implements java.io.Serializable, Resetable
A report that keeps a historical record of the shouts in the market that lead
to the last N transactions. This logger is used to keep historical data that
is used by various different trading strategies.
- Version:
- $Revision: 1.6 $
- Author:
- Steve Phelps
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
asks
protected java.util.LinkedList asks
bids
protected java.util.LinkedList bids
sortedShouts
protected org.apache.commons.collections.bag.TreeBag sortedShouts
acceptedShouts
protected java.util.HashSet acceptedShouts
memorySize
protected int memorySize
currentMemoryCell
protected int currentMemoryCell
memoryBids
protected int[] memoryBids
memoryAsks
protected int[] memoryAsks
lowestAskPrice
protected double lowestAskPrice
highestBidPrice
protected double highestBidPrice
HistoricalDataReport
public HistoricalDataReport()
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
updateTransPriceLog
public void updateTransPriceLog(TransactionExecutedEvent event)
initialise
public void initialise()
reset
public void reset()
- Description copied from interface:
Resetable
- Reinitialise our state to the original settings.
- Specified by:
reset in interface Resetable
updateShoutLog
public void updateShoutLog(ShoutPlacedEvent event)
roundClosed
public void roundClosed(AuctionEvent event)
eventOccurred
public void eventOccurred(AuctionEvent event)
- Specified by:
eventOccurred in interface AuctionEventListener
getNumberOfTrades
public int getNumberOfTrades()
getHighestBidPrice
public double getHighestBidPrice()
getLowestAskPrice
public double getLowestAskPrice()
getBids
public java.util.List getBids()
getAsks
public java.util.List getAsks()
accepted
public boolean accepted(Shout shout)
getNumberOfAsks
public int getNumberOfAsks(double price,
boolean accepted)
getNumberOfBids
public int getNumberOfBids(double price,
boolean accepted)
sortedShoutIterator
public java.util.Iterator sortedShoutIterator()
addToSortedShouts
public void addToSortedShouts(Shout shout)
getNumberOfShouts
public int getNumberOfShouts(java.util.List shouts,
double price,
boolean accepted)
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
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
- See Also:
ReportVariable
initialisePriceRanges
protected void initialisePriceRanges()
markMatched
protected void markMatched(java.util.List shouts)
finalReport
public void finalReport()
toString
public java.lang.String toString()