|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
edu.cuny.cat.trader.marketselection.AbstractMarketSelectionStrategy
public abstract class AbstractMarketSelectionStrategy
An abstract market selection strategy, the super class of all the implementations of market selection strategy.
Field Summary | |
---|---|
protected java.util.SortedSet<java.lang.Integer> |
activeMarkets
active specialists' indices in markets from which this strategy
will choose one daily |
protected AbstractTradingAgent |
agent
the trading agent that plays this strategy |
protected int |
currentMarketIndex
the index of selected specialist in markets . |
protected java.util.Map<Specialist,java.lang.Integer> |
marketIndices
mapping from specialists to their indices in markets |
protected Specialist[] |
markets
the complete list of specialists including active and inactive ones |
Constructor Summary | |
---|---|
AbstractMarketSelectionStrategy()
|
Method Summary | |
---|---|
protected void |
addActiveSpecialist(Specialist specialist)
|
void |
eventOccurred(AuctionEvent event)
|
Specialist |
getCurrenMarket()
|
boolean |
hasValidCurrentMarket()
|
void |
initialize()
|
void |
registerMarket()
requests to register with the specialist returned from getCurrenMarket() . |
void |
reset()
|
abstract void |
selectMarket()
selects a specialist from the list of active ones in the game, which is stored in activeMarkets . |
void |
setAgent(AbstractTradingAgent agent)
sets up the trading agent that plays this strategy. |
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. |
java.lang.String |
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 |
---|
protected AbstractTradingAgent agent
protected Specialist[] markets
protected java.util.SortedSet<java.lang.Integer> activeMarkets
markets
from which this strategy
will choose one daily
protected java.util.Map<Specialist,java.lang.Integer> marketIndices
markets
protected int currentMarketIndex
markets
.
Constructor Detail |
---|
public AbstractMarketSelectionStrategy()
Method Detail |
---|
public void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
setup
in interface edu.cuny.config.param.Parameterizable
public void initialize()
public void reset()
reset
in interface edu.cuny.obj.Resetable
public void eventOccurred(AuctionEvent event)
protected void addActiveSpecialist(Specialist specialist)
protected void setupMarkets(java.util.Collection<Specialist> marketColl)
marketColl
- the collection of specialists participating in the gamepublic abstract void selectMarket()
activeMarkets
.
public void registerMarket()
getCurrenMarket()
.
public Specialist getCurrenMarket()
public boolean hasValidCurrentMarket()
public void setAgent(AbstractTradingAgent agent)
agent
- public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |