edu.cuny.cat.trader.marketselection
Class StaticMarketSelectionStrategy

java.lang.Object
  extended by java.util.Observable
      extended by edu.cuny.cat.trader.marketselection.AbstractMarketSelectionStrategy
          extended by edu.cuny.cat.trader.marketselection.StaticMarketSelectionStrategy
All Implemented Interfaces:
edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable

public class StaticMarketSelectionStrategy
extends AbstractMarketSelectionStrategy

A market selection strategy that always chooses a particular specialist to register with.

Parameters

base.specialist
string
(the name of the specialist to choose always)

Version:
$Revision: 1.6 $
Author:
Jinzhong Niu

Field Summary
static java.lang.String P_SPECIALIST
           
protected  java.lang.String specialistId
           
protected  java.lang.Integer specialistIndex
           
 
Fields inherited from class edu.cuny.cat.trader.marketselection.AbstractMarketSelectionStrategy
activeMarkets, agent, currentMarketIndex, marketIndices, markets
 
Constructor Summary
StaticMarketSelectionStrategy()
           
 
Method Summary
 java.lang.String getSpecialistId()
           
 void selectMarket()
          always select the pre-specified specialist if it is active or none otherwise.
 void setSpecialistId(java.lang.String specialistId)
           
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
protected  void setupMarkets(java.util.Collection<Specialist> marketColl)
          initiates specialists traders may register with in the game.
 
Methods inherited from class edu.cuny.cat.trader.marketselection.AbstractMarketSelectionStrategy
addActiveSpecialist, eventOccurred, getCurrenMarket, hasValidCurrentMarket, initialize, registerMarket, reset, setAgent, toString
 
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
 

Field Detail

P_SPECIALIST

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

specialistId

protected java.lang.String specialistId

specialistIndex

protected java.lang.Integer specialistIndex
Constructor Detail

StaticMarketSelectionStrategy

public StaticMarketSelectionStrategy()
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
Overrides:
setup in class AbstractMarketSelectionStrategy

setupMarkets

protected void setupMarkets(java.util.Collection<Specialist> marketColl)
Description copied from class: AbstractMarketSelectionStrategy
initiates specialists traders may register with in the game.

Overrides:
setupMarkets in class AbstractMarketSelectionStrategy
Parameters:
marketColl - the collection of specialists participating in the game

setSpecialistId

public void setSpecialistId(java.lang.String specialistId)

getSpecialistId

public java.lang.String getSpecialistId()

selectMarket

public void selectMarket()
always select the pre-specified specialist if it is active or none otherwise.

Specified by:
selectMarket in class AbstractMarketSelectionStrategy