edu.cuny.cat.market.accepting
Class TransactionBasedAcceptingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.accepting.ShoutAcceptingPolicy
          extended by edu.cuny.cat.market.accepting.OnlyNewShoutDecidingAcceptingPolicy
              extended by edu.cuny.cat.market.accepting.TransactionBasedAcceptingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable

public class TransactionBasedAcceptingPolicy
extends OnlyNewShoutDecidingAcceptingPolicy

the accepting policy that tracks matched asks and bids and uses lowest matched bid and highest matched ask to restrict the shouts to be accepted. This aims to increase the transation success rate.

Version:
$Revision: 1.5 $
Author:
Jinzhong Niu

Field Summary
protected  double delta
          used to relax the restriction
protected  double highestAskPrice
           
protected  double lowestBidPrice
           
protected  double maxDailyAcceptedAsk
           
protected  double minDailyAcceptedBid
           
 
Fields inherited from class edu.cuny.cat.market.accepting.ShoutAcceptingPolicy
P_DEF_BASE
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
TransactionBasedAcceptingPolicy()
           
 
Method Summary
 void check(Shout shout)
          accepts all shouts and IllegalShoutException is never thrown.
 void eventOccurred(AuctionEvent event)
           
 void reset()
          resets the state to be the same as the policy is created and initialized.
 
Methods inherited from class edu.cuny.cat.market.accepting.OnlyNewShoutDecidingAcceptingPolicy
check
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
getAuctioneer, initialize, setAuctioneer, setup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minDailyAcceptedBid

protected double minDailyAcceptedBid

maxDailyAcceptedAsk

protected double maxDailyAcceptedAsk

lowestBidPrice

protected double lowestBidPrice

highestAskPrice

protected double highestAskPrice

delta

protected double delta
used to relax the restriction

Constructor Detail

TransactionBasedAcceptingPolicy

public TransactionBasedAcceptingPolicy()
Method Detail

reset

public void reset()
Description copied from class: AuctioneerPolicy
resets the state to be the same as the policy is created and initialized.

Specified by:
reset in interface edu.cuny.obj.Resetable
Overrides:
reset in class AuctioneerPolicy

check

public void check(Shout shout)
           throws IllegalShoutException
accepts all shouts and IllegalShoutException is never thrown.

Specified by:
check in class OnlyNewShoutDecidingAcceptingPolicy
Parameters:
shout - the shout being checked.
Throws:
IllegalShoutException
See Also:
OnlyNewShoutDecidingAcceptingPolicy.check(edu.cuny.cat.core.Shout)

eventOccurred

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