public class RL_client_agent 
{
    protected static final String kUnknownMessage = "Unknown Message: ";
    protected RL_netlib netlib;
    protected AgentType agent;

    public RL_client_agent() 
    {
	agent = new AgentType();
    }

    protected void onAgentInit() 
    {
	String taskSpec = netlib.getInputStream().readString();
	agent.agent_init(taskSpec);
    }

    protected void onAgentStart() 
    {
	final RLAbstractType observation = netlib.readAbstractType();
	final RLAbstractType action = agent.agent_start(observation);
	netlib.writeAbstractType(action);
    }

    protected void onAgentStep()
    {
	final double reward = netlib.readDouble();
	final RLAbstractType observation = netlib.readAbstractType();
	final RLAbstractType action = agent.agent_step(reward, observation);
	netlib.writeAbstractType(action);
    }

    protected void onAgentEnd()
    {
	final double reward = netlib.readDouble();
	agent.agent_end();
    }

    protected void onAgentCleanup()
    {
	agent.agent_cleanup();
    }

    protected void onAgentFreeze() 
    {
	agent.agent_freeze();
    }

    protected void onAgentMessage()
    {
	final String recvMessage = netlib.readString();
	final String sendMessage = agent.agent_message(recvMessage);

	/* this is not finished */
    }

    /* Should fix this and the RL_netlib constructor to throw more specific exceptions */
    protected void connect(String host, int port, int timeout) throws Exception
    {	
	netlib = new RL_netlib(host, port, timeout);
    }

    protected void runAgentEventLoop(Socket theSocket) 
    {
	int agentState = 0;

	InputDataStream input = theSocket.getInputDataStream();
	agentState = input.readInt();

	do {

	    switch(agentState) {
	    case kAgentInit:
		onAgentInit();
		break;
		
	    case kAgentStart:
		onAgentStart();
		break;
		
	    case kAgentStep:
		onAgentStep();
		break;
		
	    case kAgentEnd:
		onAgentEnd();
		break;
		
	    case kAgentCleanup:
		onAgentCleanup();
		break;
		
	    case kAgentFreeze:
		onAgentFreeze();
		break;
		
	    case kAgentMessage:
		onAgentMessage();
		break;
		
	    default:
		System.err.println(kUnknownMessage + agentState + "\n");
		System.exit(1);
		break;
	    };

	} while (agentState != kAgentCleanup);
    }

    protected void close() 
    {
	netlib.close();
    }

    public static void main(String [] args) 
    {
	RL_client_agent client = new RL_client_agent();
	boolean autoReconnect = false;

	do {
	    client.connect(host, port, kRetryTimeout);
	    client.runAgentEventLoop();
	    client.close();
	} while (autoReconnect);
    }
}
@@ -1,12 +1,43 @@
+package rlglue.network.agent;%0A%0A
 public class
@@ -37,28 +37,19 @@
 c class 
-RL_client_ag
+Cli
 ent %0A%7B%0A 
@@ -138,24 +138,38 @@
 ted 
-RL_netlib netlib
+rlglue.network.Network network
 ;%0A  
@@ -209,28 +209,19 @@
  public 
-RL_client_ag
+Cli
 ent() %0A 
@@ -247,24 +247,65 @@
 gentType();%0A
+%09network = new rlglue.network.Network();%0A
     %7D%0A%0A    p
@@ -361,19 +361,20 @@
 ec = net
-lib
+work
 .getInpu
@@ -477,38 +477,35 @@
    %7B%0A%09final 
-RLAbstractType
+Observation
  observation
@@ -510,36 +510,36 @@
 on = net
-lib
+work
 .read
-AbstractType
+Observation
 ();%0A%09fin
@@ -537,38 +537,30 @@
 n();%0A%09final 
-RLAbstractType
+Action
  action = ag
@@ -593,37 +593,32 @@
 n);%0A%09net
-lib
+work
 .writeA
-bstractType
+ction
 (action)
@@ -2404,25 +2404,23 @@
    %7B%0A%09RL
-_c
+C
 lient
-_a
+A
 gent cli
@@ -2435,17 +2435,15 @@
 w RL
-_c
+C
 lient
-_a
+A
 gent

Update to java stuff