uk.ac.liv.auction.agent
Class MarkupStrategyDecorator

java.lang.Object
  extended byuk.ac.liv.auction.agent.AbstractStrategy
      extended byuk.ac.liv.auction.agent.FixedQuantityStrategyImpl
          extended byuk.ac.liv.auction.agent.MarkupStrategyDecorator
All Implemented Interfaces:
AuctionEventListener, java.lang.Cloneable, FixedQuantityStrategy, Parameterizable, Prototypeable, Resetable, java.io.Serializable, Strategy

public class MarkupStrategyDecorator
extends FixedQuantityStrategyImpl
implements java.io.Serializable, Prototypeable

This strategy decorates a component strategy by bidding a fixed proportional markup over the price specified by the underlying component strategy.

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

Field Summary
protected  double markup
          The proportional markup on the sub strategy.
static java.lang.String P_MARKUP
           
static java.lang.String P_SUBSTRATEGY
           
protected  Strategy subStrategy
          The component strategy to decorate.
 
Fields inherited from class uk.ac.liv.auction.agent.AbstractStrategy
agent, auction, currentShout
 
Constructor Summary
MarkupStrategyDecorator()
           
 
Method Summary
 void endOfRound(Auction auction)
           
 void eventOccurred(AuctionEvent event)
           
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
 java.lang.Object protoClone()
           
 void setAgent(AbstractTradingAgent agent)
           
 void setup(ec.util.ParameterDatabase parameters, ec.util.Parameter base)
          Initialise this object from a parameter database.
 
Methods inherited from class uk.ac.liv.auction.agent.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class uk.ac.liv.auction.agent.AbstractStrategy
getAgent, initialise, modifyShout, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.liv.util.Resetable
reset
 
Methods inherited from interface uk.ac.liv.auction.agent.Strategy
modifyShout
 

Field Detail

subStrategy

protected Strategy subStrategy
The component strategy to decorate.


markup

protected double markup
The proportional markup on the sub strategy.


P_SUBSTRATEGY

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

P_MARKUP

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

MarkupStrategyDecorator

public MarkupStrategyDecorator()
Method Detail

setup

public void setup(ec.util.ParameterDatabase parameters,
                  ec.util.Parameter base)
Description copied from interface: Parameterizable
Initialise this object from a parameter database.

Specified by:
setup in interface Parameterizable
Overrides:
setup in class FixedQuantityStrategyImpl

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 FixedQuantityStrategyImpl

endOfRound

public void endOfRound(Auction auction)
Specified by:
endOfRound in class AbstractStrategy

eventOccurred

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

setAgent

public void setAgent(AbstractTradingAgent agent)
Specified by:
setAgent in interface Strategy
Overrides:
setAgent in class AbstractStrategy

protoClone

public java.lang.Object protoClone()
Specified by:
protoClone in interface Prototypeable
Overrides:
protoClone in class AbstractStrategy