edu.cuny.cat.market.matching
Class SplineThetaShoutEngine

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.matching.ShoutEngine
          extended by edu.cuny.cat.market.matching.LazyMaxVolumeShoutEngine
              extended by edu.cuny.cat.market.matching.ThetaShoutEngine
                  extended by edu.cuny.cat.market.matching.SplineThetaShoutEngine
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable
Direct Known Subclasses:
SplineThetaShoutEngineWithNumberedParam, SplineThetaShoutEngineWithStringParam

public class SplineThetaShoutEngine
extends ThetaShoutEngine

An adaptive version of ThetaShoutEngine in which theta changes according to an interpolated cubic spline. This aims to allow the shout engine to adjust the level of matching dynamically within a trading day. This class is not based on configuration from parameter files but from setters. To that end, some subclasses of this class should be used.

Version:
$Revision: 1.4 $
Author:
Jinzhong Niu

Field Summary
protected  org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction spline
          cubic spline function generated based on thetas.
protected  double[] thetas
          thetas to generated spline interpolation.
 
Fields inherited from class edu.cuny.cat.market.matching.ThetaShoutEngine
DEFAULT_THETA, orderly, P_DEF_BASE, P_ORDERLY, P_THETA, theta
 
Fields inherited from class edu.cuny.cat.market.matching.LazyMaxVolumeShoutEngine
asks, bids, bIn, bOut, matchingVolume, sIn, sOut, uniform
 
Fields inherited from class edu.cuny.cat.market.matching.ShoutEngine
AscendingOrder, DescendingOrder
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
SplineThetaShoutEngine()
           
 
Method Summary
 void eventOccurred(AuctionEvent event)
           
 void setThetas(double[] thetas)
           
protected  void setupSpline(int dayLen)
          initialize the spline interpolation function with the given number of rounds within a day.
 java.lang.String toString()
           
 
Methods inherited from class edu.cuny.cat.market.matching.ThetaShoutEngine
calculateEquilibriumQuantity, calculateMatchingQuantity, calculateUnorderlyQuantity, getDemandAboveLowestAsk, getOrderly, getTheta, matchShouts, setOrderly, setTheta, setup, validateTheta
 
Methods inherited from class edu.cuny.cat.market.matching.LazyMaxVolumeShoutEngine
ascendingAskIterator, askIterator, bidIterator, descendingBidIterator, distributeShouts, distributeShoutsFromHead, distributeShoutsFromTail, getHighestMatchedAsk, getHighestUnmatchedBid, getLowestMatchedBid, getLowestUnmatchedAsk, getMatchedAsks, getMatchedBids, getMatchedVolume, getNumOfMatchedAsks, getNumOfMatchedBids, getNumOfUnmatchedAsks, getNumOfUnmatchedBids, getUnmatchedAsks, getUnmatchedBids, getUnmatchedDemand, getUnmatchedSupply, matchedAskIterator, matchedBidIterator, newShout, prettyPrint, printState, randomizeMatches, removeShout, reset, updateMatchedShouts
 
Methods inherited from class edu.cuny.cat.market.matching.ShoutEngine
getMatchedShouts
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
getAuctioneer, initialize, setAuctioneer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thetas

protected double[] thetas
thetas to generated spline interpolation.


spline

protected org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction spline
cubic spline function generated based on thetas.

Constructor Detail

SplineThetaShoutEngine

public SplineThetaShoutEngine()
Method Detail

setThetas

public void setThetas(double[] thetas)
Parameters:
thetas -

setupSpline

protected void setupSpline(int dayLen)
initialize the spline interpolation function with the given number of rounds within a day.

Parameters:
dayLen - number of rounds per day

eventOccurred

public void eventOccurred(AuctionEvent event)
Specified by:
eventOccurred in interface AuctionEventListener
Overrides:
eventOccurred in class AuctioneerPolicy

toString

public java.lang.String toString()
Overrides:
toString in class ThetaShoutEngine