edu.cuny.cat.market.charging
Class ChargingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.charging.ChargingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable
Direct Known Subclasses:
AdaptiveChargingPolicy, BaitAndSwitchChargingPolicy, ChargeCuttingChargingPolicy, CombiChargingPolicy, FixedChargingPolicy

public abstract class ChargingPolicy
extends AuctioneerPolicy

A charging policy determines how much a market charges.

Currently, 5 different types of charges are supported, flat charge on registration (participation in a market), flat charge on information on market activities, flat charge on shouts, flat charge on transactions, and fractional charge on transaction profit.

Default Base

charging

Version:
$Revision: 1.23 $
Author:
Jinzhong Niu

Field Summary
static int[] FEE_TYPES
          types of the fees a specialist may charge, being FLAT or FRACTIONAL
protected  double[] fees
          current charges
static int FLAT
          type of fee charged flatly
static int FRACTIONAL
          type of fee charged at a fraction of another value
static int INFORMATION_INDEX
          index of information fee in P_FEES.
static double[] MAXES
          maximum values for different types of fees
static double[] MINES
          minimum values for different types of fees
static java.lang.String P_DEF_BASE
           
static java.lang.String[] P_FEES
           
static int PROFIT_INDEX
          index of profit fee in P_FEES.
static int REGISTRATION_INDEX
          index of registration fee in P_FEES.
static int SHOUT_INDEX
          index of shout fee in P_FEES.
static int TRANSACTION_INDEX
          index of transaction fee in P_FEES.
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
ChargingPolicy()
           
 
Method Summary
static boolean adjustFees(double[] fees)
           
 double[] getFees()
           
 double getInformationFee()
           
 double getProfitFee()
           
 double getRegistrationFee()
           
 double getShoutFee()
           
 double getTransactionFee()
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
eventOccurred, getAuctioneer, initialize, reset, setAuctioneer, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_DEF_BASE

public static final java.lang.String P_DEF_BASE
See Also:
Constant Field Values

P_FEES

public static final java.lang.String[] P_FEES

REGISTRATION_INDEX

public static final int REGISTRATION_INDEX
index of registration fee in P_FEES.

See Also:
Constant Field Values

INFORMATION_INDEX

public static final int INFORMATION_INDEX
index of information fee in P_FEES.

See Also:
Constant Field Values

SHOUT_INDEX

public static final int SHOUT_INDEX
index of shout fee in P_FEES.

See Also:
Constant Field Values

TRANSACTION_INDEX

public static final int TRANSACTION_INDEX
index of transaction fee in P_FEES.

See Also:
Constant Field Values

PROFIT_INDEX

public static final int PROFIT_INDEX
index of profit fee in P_FEES.

See Also:
Constant Field Values

FLAT

public static final int FLAT
type of fee charged flatly

See Also:
Constant Field Values

FRACTIONAL

public static final int FRACTIONAL
type of fee charged at a fraction of another value

See Also:
Constant Field Values

MAXES

public static final double[] MAXES
maximum values for different types of fees


MINES

public static final double[] MINES
minimum values for different types of fees


FEE_TYPES

public static final int[] FEE_TYPES
types of the fees a specialist may charge, being FLAT or FRACTIONAL


fees

protected double[] fees
current charges

Constructor Detail

ChargingPolicy

public ChargingPolicy()
Method Detail

getFees

public double[] getFees()

getRegistrationFee

public double getRegistrationFee()

getInformationFee

public double getInformationFee()

getShoutFee

public double getShoutFee()

getTransactionFee

public double getTransactionFee()

getProfitFee

public double getProfitFee()

adjustFees

public static boolean adjustFees(double[] fees)

toString

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