Qualia  0.2
Public Member Functions | Public Attributes | List of all members
QLearningAgent Class Reference

#include <QLearningAgent.h>

Inheritance diagram for QLearningAgent:
Inheritance graph
[legend]
Collaboration diagram for QLearningAgent:
Collaboration graph
[legend]

Public Member Functions

 QLearningAgent (QFunction *qFunction, Policy *policy, unsigned int observationDim, ActionProperties *actionProperties, float lambda, float gamma, bool offPolicy=false)
 
virtual ~QLearningAgent ()
 
virtual void init ()
 Initializes the agent. More...
 
virtual Actionstart (const Observation *observation)
 Chooses the first action in the episode. More...
 
virtual Actionstep (const Observation *observation)
 Performs an episode step. More...
 
virtual void end (const Observation *observation)
 Performs the last episode step. More...
 
virtual void save (XFile *file)
 Saves the agent. More...
 
virtual void load (XFile *file)
 Loads an agent. More...
 
- Public Member Functions inherited from Agent
virtual ~Agent ()
 

Public Attributes

bool isLearning
 Toggle learning. More...
 
Policypolicy
 The policy used by the agent. More...
 
QFunctionqFunction
 The state-action value approximator function. More...
 
TDTrainer trainer
 The trainer that we use to train the function. More...
 
Action lastAction
 
Action currentAction
 
RLObservation lastObservation
 
unsigned int observationDim
 

Detailed Description

An agent that behaves according to an action-value, TD-lambda reinforcement learning algorithm. The model allows for both on-policy (SARSA) and off-policy (Q-learning) learning.

Constructor & Destructor Documentation

QLearningAgent::QLearningAgent ( QFunction qFunction,
Policy policy,
unsigned int  observationDim,
ActionProperties actionProperties,
float  lambda,
float  gamma,
bool  offPolicy = false 
)
QLearningAgent::~QLearningAgent ( )
virtual

Member Function Documentation

void QLearningAgent::end ( const Observation observation)
virtual

Performs the last episode step.

Reimplemented from Agent.

void QLearningAgent::init ( )
virtual

Initializes the agent.

Reimplemented from Agent.

void QLearningAgent::load ( XFile file)
virtual

Loads an agent.

Reimplemented from Agent.

void QLearningAgent::save ( XFile file)
virtual

Saves the agent.

Reimplemented from Agent.

Action * QLearningAgent::start ( const Observation observation)
virtual

Chooses the first action in the episode.

Implements Agent.

Action * QLearningAgent::step ( const Observation observation)
virtual

Performs an episode step.

Implements Agent.

Member Data Documentation

Action QLearningAgent::currentAction
bool QLearningAgent::isLearning

Toggle learning.

Action QLearningAgent::lastAction
RLObservation QLearningAgent::lastObservation
unsigned int QLearningAgent::observationDim
Policy* QLearningAgent::policy

The policy used by the agent.

QFunction* QLearningAgent::qFunction

The state-action value approximator function.

TDTrainer QLearningAgent::trainer

The trainer that we use to train the function.


The documentation for this class was generated from the following files: