org.rlcommunity.rlglue.codec.network
Class ClientAgent

java.lang.Object
  extended by org.rlcommunity.rlglue.codec.network.ClientAgent

public class ClientAgent
extends java.lang.Object


Field Summary
protected  AgentInterface agent
           
protected  boolean killedFromLocalProcess
           
protected static java.lang.String kUnknownMessage
           
protected  Network network
           
 
Constructor Summary
ClientAgent(AgentInterface agent)
           
 
Method Summary
 void close()
           
 void connect(java.lang.String host, int port, int timeout)
          Called by agentloader.
 void killProcess()
          If you are using ClientAgent in a local context (like from Matlab) this allows us to kill the agent without quitting matlab
protected  void onAgentCleanup()
           
protected  void onAgentEnd()
           
protected  void onAgentInit()
           
protected  void onAgentMessage()
           
protected  void onAgentStart()
           
protected  void onAgentStep()
           
 void runAgentEventLoop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kUnknownMessage

protected static final java.lang.String kUnknownMessage
See Also:
Constant Field Values

network

protected Network network

agent

protected AgentInterface agent

killedFromLocalProcess

protected boolean killedFromLocalProcess
Constructor Detail

ClientAgent

public ClientAgent(AgentInterface agent)
Method Detail

killProcess

public void killProcess()
If you are using ClientAgent in a local context (like from Matlab) this allows us to kill the agent without quitting matlab


onAgentInit

protected void onAgentInit()
                    throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

onAgentStart

protected void onAgentStart()

onAgentStep

protected void onAgentStep()

onAgentEnd

protected void onAgentEnd()

onAgentCleanup

protected void onAgentCleanup()

onAgentMessage

protected void onAgentMessage()
                       throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

connect

public void connect(java.lang.String host,
                    int port,
                    int timeout)
             throws java.lang.Exception
Called by agentloader.

Parameters:
host -
port -
timeout -
Throws:
java.lang.Exception

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

runAgentEventLoop

public void runAgentEventLoop()
                       throws java.lang.Exception
Throws:
java.lang.Exception