edu.cuny.cat.market.charging
Class ShareBalancingChargingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.charging.ChargingPolicy
          extended by edu.cuny.cat.market.charging.AdaptiveChargingPolicy
              extended by edu.cuny.cat.market.charging.ShareBalancingChargingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable

public class ShareBalancingChargingPolicy
extends AdaptiveChargingPolicy

This charging policy aims to maintain a balance between its profit share and market share by adjusting its charges, since generally higher charges tend to bring more profit but lower market share, and lower charges do the opposite.

When the profit share score is higher than market share score, it learns from the daily winner on market share; while when the market share score is higher, it learns from the daily winner on profit share. To allow it to learn from itself, a perturbation is introduced. When the goal is to increase market share, the perturbation is negative, and when the goal is to increase profit share, the perturbation is positive.

Version:
$Revision: 1.8 $
Author:
Jinzhong Niu

Field Summary
protected  java.util.Map<java.lang.String,java.lang.Double> cumulativeProfits
           
protected  Specialist dailyPopularityLeader
           
protected  Specialist dailyProfitLeader
           
protected  java.util.Map<java.lang.String,java.lang.Double> dailyProfits
           
protected  java.util.Map<java.lang.String,java.lang.Integer> dailyTraderDistributions
           
protected  edu.cuny.event.RichEvent event
           
protected  double maxDailyProfit
           
 
Fields inherited from class edu.cuny.cat.market.charging.AdaptiveChargingPolicy
initialFees, learners, P_DEF_BASE, P_LEARNER, P_SCALE, perturbations, scales
 
Fields inherited from class edu.cuny.cat.market.charging.ChargingPolicy
FEE_TYPES, fees, FLAT, FRACTIONAL, INFORMATION_INDEX, MAXES, MINES, P_FEES, PROFIT_INDEX, REGISTRATION_INDEX, SHOUT_INDEX, TRANSACTION_INDEX
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
ShareBalancingChargingPolicy()
           
 
Method Summary
protected  double calculateMarketShare()
           
protected  double calculateProfitShare()
           
protected  void dayInitialize()
           
 void eventOccurred(AuctionEvent event)
           
protected  void learnCharges(Specialist leader, boolean lower)
           
 void reset()
          resets the state to be the same as the policy is created and initialized.
protected  void updateFees()
           
protected  void updateSpecialistPopularity(Specialist specialist, int numOfTraders)
           
protected  void updateSpecialistProfit(Specialist specialist)
           
 
Methods inherited from class edu.cuny.cat.market.charging.AdaptiveChargingPolicy
initialize, setup, toString
 
Methods inherited from class edu.cuny.cat.market.charging.ChargingPolicy
adjustFees, getFees, getInformationFee, getProfitFee, getRegistrationFee, getShoutFee, getTransactionFee
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
getAuctioneer, setAuctioneer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cumulativeProfits

protected final java.util.Map<java.lang.String,java.lang.Double> cumulativeProfits

dailyProfits

protected java.util.Map<java.lang.String,java.lang.Double> dailyProfits

dailyProfitLeader

protected Specialist dailyProfitLeader

maxDailyProfit

protected double maxDailyProfit

dailyTraderDistributions

protected java.util.Map<java.lang.String,java.lang.Integer> dailyTraderDistributions

dailyPopularityLeader

protected Specialist dailyPopularityLeader

event

protected final edu.cuny.event.RichEvent event
Constructor Detail

ShareBalancingChargingPolicy

public ShareBalancingChargingPolicy()
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 AdaptiveChargingPolicy

dayInitialize

protected void dayInitialize()

updateSpecialistProfit

protected void updateSpecialistProfit(Specialist specialist)

updateSpecialistPopularity

protected void updateSpecialistPopularity(Specialist specialist,
                                          int numOfTraders)

calculateProfitShare

protected double calculateProfitShare()

calculateMarketShare

protected double calculateMarketShare()

learnCharges

protected void learnCharges(Specialist leader,
                            boolean lower)
Parameters:
leader -
lower - whether to learn to lower charges or not

updateFees

protected void updateFees()

eventOccurred

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