public abstract class Comm
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
protected Types.LEARNING_SSO_TYPE |
lastSsoType
Variable to store the message type
|
protected java.lang.String |
lineSep
Line separator for messages.
|
protected long |
messageId
Message ID
|
protected java.lang.String |
TOKEN_SEP
Special character to separate message ID from actual message
|
| Constructor and Description |
|---|
Comm()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
commRecv()
Receives a message from the client.
|
abstract void |
commSend(java.lang.String msg)
Sends a message through the pipe.
|
boolean |
endComm()
This function is called at the end of the whole process.
|
int |
finishGame(StateObservation so)
This method is used to set the game state to either "ABORT_STATE" or "END_STATE"
depending on the termination of the game.
|
Types.LEARNING_SSO_TYPE |
getLastSsoType() |
abstract void |
initBuffers()
Creates the buffers for communication.
|
boolean |
startComm()
This function is called at the beginning of the game for
initialization.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected Types.LEARNING_SSO_TYPE lastSsoType
protected java.lang.String lineSep
protected java.lang.String TOKEN_SEP
protected long messageId
public int finishGame(StateObservation so)
so - State observation of the game in progress to be used for message sending.public boolean startComm()
public boolean endComm()
public abstract void initBuffers()
public abstract java.lang.String commRecv()
throws java.io.IOException
java.io.IOExceptionpublic abstract void commSend(java.lang.String msg)
throws java.io.IOException
msg - message to send.java.io.IOExceptionpublic Types.LEARNING_SSO_TYPE getLastSsoType()