lnsc.page
Class AbstractObservableAgent

java.lang.Object
  |
  +--java.util.Observable
        |
        +--lnsc.page.AbstractObservableAgent
All Implemented Interfaces:
Agent, java.io.Serializable
Direct Known Subclasses:
ActorCritic_PDAETLSTM_Monkey2, ActorCritic_PETLSTM_Monkey1, Rivest06

public abstract class AbstractObservableAgent
extends java.util.Observable
implements Agent

Optional basis for class implementing Agent interface. Derived classes constructor must fill the protected variables. Add necessary Agent information and properties. In general setEvalMode should be overrided. Same as AbstractAgent, but derived from java.util.Observer.

Agent could themselves notify their oberver by the end ot the Agent.requestAction(lnsc.page.State) process, or should at least call #setChanged(). notifyObservers() send a {@link #toDataSet} description by default.

Agents are assumed serializable! Episode state information should be transient! The observers list is not!

See Also:
Serialized Form

Constructor Summary
AbstractObservableAgent()
           
 
Method Summary
 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 notifyObservers()
           
 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.
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lnsc.page.Agent
endEpisode, newEpisode, requestAction, returnReward
 

Constructor Detail

AbstractObservableAgent

public AbstractObservableAgent()
Method Detail

getEvalMode

public boolean getEvalMode()
Description copied from interface: Agent
Indicates whether the agent is in evaluation mode.

Specified by:
getEvalMode in interface Agent
Returns:
true if it is in evaluation mode. false if it is in normal possibly adaptive mode.

isAdaptive

public boolean isAdaptive()
Description copied from interface: Agent
Indicates whether the agent is static (never adapts, no learning) or adaptives (the agents learn).

Specified by:
isAdaptive in interface Agent
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()
Description copied from interface: Agent
Indicates whether the agent can be placed in eval mode.

Specified by:
isEvaluable in interface Agent
Returns:
true if the agent can be placed in eval mode. false if the agent is always adapting anyway.

notifyObservers

public void notifyObservers()
Overrides:
notifyObservers in class java.util.Observable

setEvalMode

public void setEvalMode(boolean newEvalMode)
Description copied from interface: Agent
Sets the agent in evaluation mode, that is, no training should append.

Specified by:
setEvalMode in interface Agent
Parameters:
newEvalMode - true to set it into evaluation mode. false to set it into normal possibly adaptive mode.

toDataSet

public DataSet toDataSet()
Description copied from interface: Agent
Similar to the toString method, but return state content in the form of a DataSet. Can be null.

Specified by:
toDataSet in interface Agent
Returns:
A DataSet containing a description of the State.