edu.iastate.jrelm.demo
Class RothErevAgent<A extends Action<java.lang.Integer>>

java.lang.Object
  extended by edu.iastate.jrelm.demo.RothErevAgent<A>
All Implemented Interfaces:
JReLMAgent<RELearner>
Direct Known Subclasses:
GamblerAgent

public class RothErevAgent<A extends Action<java.lang.Integer>>
extends java.lang.Object
implements JReLMAgent<RELearner>

This agent is meant to demonstrate the use of the core components. It is a simple agent with behavior driven by a modified version of the Roth-Erev reinforcement learning algorithm. It must at least be supplied with a learning domain and parameters for the learning algortithm.

Use nextAction() to elicit a choice of action from the agent in the form of an Action object selected from the given action domain. Use activate(double) to give the agent feedback in the for of a double. This will trigger the learning process.

The type of Action and ActionDomain may be specified through parameters. This agent has been set to use RothErevActionID internally as it is using a ARELearner.

Author:
Charles Gieseler

Constructor Summary
RothErevAgent(REParameters params, ActionDomain<java.lang.Integer,A> dom)
          Build agent driven by Roth-Erev Reinforcement Learning.
RothErevAgent(REParameters params, ActionDomain<java.lang.Integer,A> dom, java.lang.String agentID)
          Build agent driven by Roth-Erev Reinforcement Learning.
 
Method Summary
 A chooseAction()
          Elicits a choice of action from the agent.
 java.lang.String getID()
          Retreive a String identifier for this agent.
 RELearner getLearner()
          Retrieve the leaner this agent is using.
 void receiveFeedback(double feedback)
          Use this to give the agent input from the environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RothErevAgent

public RothErevAgent(REParameters params,
                     ActionDomain<java.lang.Integer,A> dom,
                     java.lang.String agentID)
Build agent driven by Roth-Erev Reinforcement Learning.

Parameters:
dom - - A DiscreteFiniteAction
agentID - - identifier for this agent ("Anonymous" by default)
parameters - - parameters for Roth-Erev learning

RothErevAgent

public RothErevAgent(REParameters params,
                     ActionDomain<java.lang.Integer,A> dom)
Build agent driven by Roth-Erev Reinforcement Learning. This agent will have an "Anonymous" id.

Parameters:
dom - - A DiscreteFiniteAction
parameters - - parameters for Roth-Erev learning
Method Detail

receiveFeedback

public void receiveFeedback(double feedback)
Use this to give the agent input from the environment. Input should be the resulting "reward" an agent received from it's last action. This simple agent can only receive feedback in the form of a double.

Parameters:
feedback - - double representing the result of the agent's last action

chooseAction

public A chooseAction()
Elicits a choice of action from the agent. The action will be chosen from the given learning domain according to selection rule of the SimpleStatelessPolicy.

Returns:
the next action to perform
See Also:
SimpleStatelessPolicy.generateAction()

getID

public java.lang.String getID()
Description copied from interface: JReLMAgent
Retreive a String identifier for this agent.

Specified by:
getID in interface JReLMAgent<RELearner>
Returns:
See Also:
JReLMAgent.getID()

getLearner

public RELearner getLearner()
Description copied from interface: JReLMAgent
Retrieve the leaner this agent is using.

Specified by:
getLearner in interface JReLMAgent<RELearner>
Returns:
See Also:
JReLMAgent.getLearner()