org.rlcommunity.rlglue.codec
Class RLGlue

java.lang.Object
  extended by org.rlcommunity.rlglue.codec.RLGlue

public class RLGlue
extends java.lang.Object

This is the main RLGlue interface class for Experiment Programs.

This class is meant to be accessed statically, like:

For future flexibility, we have made this class use an instance of type RLGlueInterface. This will allow RL-Viz and other project swap out the network codec for a local (direct-compile) implementation without requiring any changes to the experiment program.

Since this class offers some convenient extensions, the traditional RL-Glue methods have all been labeled as 'RL-Glue Core Method'.

Author:
btanner

Method Summary
static boolean isCurrentEpisodeOver()
          Non-Core Method.
static boolean isInited()
          Non-Core Method.
static void resetGlueProxy()
          Non-Core Method.
static void RL_agent_end(double theReward)
           
static java.lang.String RL_agent_message(java.lang.String message)
          RL-Glue Core Method.
static Action RL_agent_start(Observation theObservation)
           
static Action RL_agent_step(double theReward, Observation theObservation)
           
static void RL_cleanup()
          RL-Glue Core Method.
static java.lang.String RL_env_message(java.lang.String message)
          RL-Glue Core Method.
static Observation RL_env_start()
           
static Reward_observation_terminal RL_env_step(Action theAction)
          RL-Glue Core Method.
static int RL_episode(int numSteps)
          RL-Glue Core Method.
static java.lang.String RL_init()
          RL-Glue Core Method.
static int RL_num_episodes()
          RL-Glue Core Method.
static int RL_num_steps()
          RL-Glue Core Method.
static double RL_return()
          RL-Glue Core Method.
static Observation_action RL_start()
          RL-Glue Core Method.
static Reward_observation_action_terminal RL_step()
          RL-Glue Core Method.
static void setGlue(RLGlueInterface alternateGlueEngine)
          Non-Core Method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setGlue

public static void setGlue(RLGlueInterface alternateGlueEngine)
Non-Core Method.

If you have an alternate RL-Glue engine (like the localGlue engine from RL-Viz), you can use this method to specify the engine instead of the network engine.

Parameters:
alternateGlueEngine - The alternate glue engine.
Since:
2.0

resetGlueProxy

public static void resetGlueProxy()
Non-Core Method.

If you wanted to run multiple independent experiments within a single Experiment program, you could call this method in between. This will disconnect you from the glue.

This has not been thoroughly tested : it is useful for RL-Viz.

Since:
2.0

isInited

public static boolean isInited()
Non-Core Method. Has RL_init been called yet? (or since the last cleanup?)

Returns:
Whether RL_init has been called.
Since:
2.0

RL_agent_message

public static java.lang.String RL_agent_message(java.lang.String message)
RL-Glue Core Method.


RL_env_message

public static java.lang.String RL_env_message(java.lang.String message)
RL-Glue Core Method.


RL_cleanup

public static void RL_cleanup()
RL-Glue Core Method.


RL_episode

public static int RL_episode(int numSteps)
RL-Glue Core Method.


RL_init

public static java.lang.String RL_init()
RL-Glue Core Method.


RL_num_episodes

public static int RL_num_episodes()
RL-Glue Core Method.


RL_num_steps

public static int RL_num_steps()
RL-Glue Core Method.


RL_return

public static double RL_return()
RL-Glue Core Method.


RL_start

public static Observation_action RL_start()
RL-Glue Core Method.


RL_env_start

public static Observation RL_env_start()

RL_agent_start

public static Action RL_agent_start(Observation theObservation)

RL_step

public static Reward_observation_action_terminal RL_step()
RL-Glue Core Method.


RL_env_step

public static Reward_observation_terminal RL_env_step(Action theAction)
RL-Glue Core Method.


RL_agent_step

public static Action RL_agent_step(double theReward,
                                   Observation theObservation)

RL_agent_end

public static void RL_agent_end(double theReward)

isCurrentEpisodeOver

public static boolean isCurrentEpisodeOver()
Non-Core Method. Returns whether the current episode is active or not.

Will return true BEFORE RL_start is called, and after a terminal response has been returned from the environment (until next RL_start call).