|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cuny.cat.GameClient
edu.cuny.cat.TraderClient
public class TraderClient
Main class of a trader client, used to launch a single such client. To start
a jcat competition simulation with game server and multiple clients, the
Game
class should be used and in this case, TraderClient is involved
but not as a main class.
A trader client creates a TradingAgent
to choose markets and
determine prices to offer.
Nested Class Summary | |
---|---|
protected class |
TraderClient.TransactionSession
|
Field Summary | |
---|---|
protected TradingAgent |
agent
the trading agent that bids and chooses markets for this client. |
protected Shout |
currentShout
currently placed or pending shout if null, no such shout. |
protected Specialist |
registeredSpecialist
the specialist this trader registers with on the current day |
protected Trader |
trader
this client as a Trader . |
Fields inherited from class edu.cuny.cat.GameClient |
---|
clientConnector, clientId, connection, connTrialMax, dispatcher, eventEngine, eventListeners, infrast, logging, P_CONNECTION_TRIAL_MAX, P_DEF_BASE, P_ID, P_LOGGING, P_REPORT, P_TYPE, prng, proactiveSessions, reactiveSessions, registry, report, tag, type |
Constructor Summary | |
---|---|
TraderClient()
|
Method Summary | |
---|---|
ClientRegistry |
createRegistry()
|
void |
eventOccurred(AuctionEvent event)
|
TradingAgent |
getAgent()
|
protected CatpReactiveSession |
getDayOpenedSessionInstance()
|
protected CatpReactiveSession |
getDayOpeningSessionInstance()
|
static void |
main(java.lang.String[] args)
for starting trader clients alone, separating from market clients and server |
protected void |
postTransactionReceived(Transaction transaction)
This method should be implemented by TraderClient and
MarketClient respectively to check the validity of the posted
transaction. |
void |
setup(edu.cuny.config.param.ParameterDatabase parameters,
edu.cuny.config.param.Parameter base)
|
void |
update(java.util.Observable source,
java.lang.Object arg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected TradingAgent agent
protected Trader trader
Trader
.
protected Specialist registeredSpecialist
protected Shout currentShout
Constructor Detail |
---|
public TraderClient()
Method Detail |
---|
public ClientRegistry createRegistry()
createRegistry
in class GameClient
public void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
setup
in interface edu.cuny.config.param.Parameterizable
setup
in class GameClient
public TradingAgent getAgent()
public void update(java.util.Observable source, java.lang.Object arg)
update
in interface java.util.Observer
update
in class GameClient
protected CatpReactiveSession getDayOpeningSessionInstance()
getDayOpeningSessionInstance
in class GameClient
protected CatpReactiveSession getDayOpenedSessionInstance()
getDayOpenedSessionInstance
in class GameClient
protected void postTransactionReceived(Transaction transaction)
GameClient
TraderClient
and
MarketClient
respectively to check the validity of the posted
transaction.
postTransactionReceived
in class GameClient
transaction
- the posted transactionpublic void eventOccurred(AuctionEvent event)
eventOccurred
in interface AuctionEventListener
public static void main(java.lang.String[] args)
args
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |