edu.cuny.cat.trader.strategy
Class FixedQuantityStrategyImpl

java.lang.Object
  extended by java.util.Observable
      extended by edu.cuny.cat.trader.strategy.AbstractStrategy
          extended by edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
All Implemented Interfaces:
AuctionEventListener, FixedQuantityStrategy, Strategy, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Prototypeable, edu.cuny.obj.Resetable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AdaptiveStrategyImpl, GDStrategy, PureSimpleStrategy, RandomConstrainedStrategy, TruthTellingStrategy

public abstract class FixedQuantityStrategyImpl
extends AbstractStrategy
implements FixedQuantityStrategy, edu.cuny.config.param.Parameterizable, java.io.Serializable

An abstract implementation of FixedQuantityStrategy.

Parameters

base.quantity
int >= 0
(the quantity to bid for in each shout)

Default Base

fixed_quantity_strategy

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

Field Summary
static java.lang.String P_DEF_BASE
           
protected  int quantity
           
 
Fields inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
agent, currentShout, MIN_PRICE_DIFFERENCE
 
Constructor Summary
FixedQuantityStrategyImpl()
           
FixedQuantityStrategyImpl(AbstractTradingAgent agent)
           
 
Method Summary
 int determineQuantity()
           
 int getQuantity()
           
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
 void setQuantity(int quantity)
          Specify the quantity to bid for.
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
eventOccurred, getAgent, initialize, modifyShout, protoClone, requiresAuctionHistory, reset, setAgent
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cuny.cat.trader.strategy.Strategy
modifyShout, requiresAuctionHistory, setAgent
 
Methods inherited from interface edu.cuny.obj.Prototypeable
protoClone
 
Methods inherited from interface edu.cuny.obj.Resetable
reset
 
Methods inherited from interface edu.cuny.cat.event.AuctionEventListener
eventOccurred
 

Field Detail

quantity

protected int quantity

P_DEF_BASE

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

FixedQuantityStrategyImpl

public FixedQuantityStrategyImpl()

FixedQuantityStrategyImpl

public FixedQuantityStrategyImpl(AbstractTradingAgent agent)
Method Detail

setup

public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
Specified by:
setup in interface edu.cuny.config.param.Parameterizable

setQuantity

public void setQuantity(int quantity)
Description copied from interface: FixedQuantityStrategy
Specify the quantity to bid for.

Specified by:
setQuantity in interface FixedQuantityStrategy

getQuantity

public int getQuantity()

determineQuantity

public int determineQuantity()
Specified by:
determineQuantity in interface Strategy

modifyShout

public boolean modifyShout(Shout.MutableShout shout)
Description copied from class: AbstractStrategy
Modify the price and quantity of the given shout according to this strategy.

Overrides:
modifyShout in class AbstractStrategy
Returns:
false if no shout is to be placed at this time

toString

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