lnsc.page
Interface Agent

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractAgent, AbstractObservableAgent

public interface Agent
extends java.io.Serializable

Defines an agent as generally understand in RL and other AI problems.

Agents are assumed serializable! Episode state information should be transient!


Method Summary
 void endEpisode(State finalState)
          Used by the state space (or environement) to tell the agent that the episode is terminated.
 boolean getEvalMode()
          Indicates whether the agent is in evaluation mode.
 boolean isAdaptive()
          Indicates whether the agent is static (never adapts, no learning) or adaptives (the agents learn).
 boolean isEvaluable()
          Indicates whether the agent can be placed in eval mode.
 void newEpisode(State newState)
          Used to tell the agent that a new episode is beginning.
 Action requestAction(State currentState)
          Used by the State space (or environment) to request an action from the agent.
 void returnReward(State resultState, double reward)
          Used by the state space (or environement) to return the result from the last action done thought RequestActions.
 void setEvalMode(boolean newEvalMode)
          Sets the agent in evaluation mode, that is, no training should append.
 DataSet toDataSet()
          Similar to the toString method, but return state content in the form of a DataSet.
 

Method Detail

endEpisode

public void endEpisode(State finalState)
Used by the state space (or environement) to tell the agent that the episode is terminated.

Parameters:
finalState - Final state of the episode.

getEvalMode

public boolean getEvalMode()
Indicates whether the agent is in evaluation mode.

Returns:
true if it is in evaluation mode. false if it is in normal possibly adaptive mode.

isAdaptive

public boolean isAdaptive()
Indicates whether the agent is static (never adapts, no learning) or adaptives (the agents learn).

Returns:
true if the agent can learns or adapt when eval mode is true, false if the agent never adapts (i.e. always in eval mode).

isEvaluable

public boolean isEvaluable()
Indicates whether the agent can be placed in eval mode.

Returns:
true if the agent can be placed in eval mode. false if the agent is always adapting anyway.

newEpisode

public void newEpisode(State newState)
Used to tell the agent that a new episode is beginning.

Parameters:
newState - First stae of the episode.

requestAction

public Action requestAction(State currentState)
Used by the State space (or environment) to request an action from the agent. In that case the agent should returns its desired action.

Parameters:
currentState - The current state of the agent.
Returns:
The action to be done.

returnReward

public void returnReward(State resultState,
                         double reward)
Used by the state space (or environement) to return the result from the last action done thought RequestActions.

Parameters:
resultState - Resulting state from last action.
reward - Resulting reward from last action.

setEvalMode

public void setEvalMode(boolean newEvalMode)
Sets the agent in evaluation mode, that is, no training should append.

Parameters:
newEvalMode - true to set it into evaluation mode. false to set it into normal possibly adaptive mode.

toDataSet

public DataSet toDataSet()
Similar to the toString method, but return state content in the form of a DataSet. Can be null.

Returns:
A DataSet containing a description of the State.