edu.cuny.cat.market.pricing
Class UniformPricingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.pricing.PricingPolicy
          extended by edu.cuny.cat.market.pricing.KPricingPolicy
              extended by edu.cuny.cat.market.pricing.UniformPricingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable, java.io.Serializable

public class UniformPricingPolicy
extends KPricingPolicy
implements java.io.Serializable

A pricing policy in which we set the transaction price in the interval between the ask quote and the bid quote as determined by the parameter k. The pricing policy is uniform in the sense that individual bid and ask prices are ignored, thus all agents performing transactions in the clearing operation will pay the same price.

An exception is that if the transaction price determined in this way falls out of the price interval of the matching ask and bid, the nearest boundary of the interval will be used as the transaction price. This may happen when, for example, LazyMaxVolumeShoutEngine is used to match shouts.

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

Field Summary
 
Fields inherited from class edu.cuny.cat.market.pricing.KPricingPolicy
DEFAULT_K, k, P_DEF_BASE, P_K
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
UniformPricingPolicy()
           
UniformPricingPolicy(double k)
           
 
Method Summary
 double determineClearingPrice(Shout bid, Shout ask, MarketQuote clearingQuote)
           
protected  double price(double quote, Shout shout)
          adjusts the price of market quote based on the given shout when the market quote does not have a valid value.
 
Methods inherited from class edu.cuny.cat.market.pricing.KPricingPolicy
getK, kInterval, setK, setup, toString
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
eventOccurred, getAuctioneer, initialize, reset, setAuctioneer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniformPricingPolicy

public UniformPricingPolicy()

UniformPricingPolicy

public UniformPricingPolicy(double k)
Method Detail

price

protected double price(double quote,
                       Shout shout)
adjusts the price of market quote based on the given shout when the market quote does not have a valid value. This is possible when certain quoting policies, say SingleSidedQuotingPolicy, are used and the market quote is an infinite value.

Parameters:
quote -
shout -
Returns:
the value of quote if it is not NaN or an infinite value, or the price of the shout otherwise.

determineClearingPrice

public double determineClearingPrice(Shout bid,
                                     Shout ask,
                                     MarketQuote clearingQuote)
Specified by:
determineClearingPrice in class PricingPolicy