Qualia
0.2
|
#include <QLearningAgent.h>
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 Action * | start (const Observation *observation) |
Chooses the first action in the episode. More... | |
virtual Action * | step (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... | |
![]() | |
virtual | ~Agent () |
Public Attributes | |
bool | isLearning |
Toggle learning. More... | |
Policy * | policy |
The policy used by the agent. More... | |
QFunction * | qFunction |
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 |
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.
QLearningAgent::QLearningAgent | ( | QFunction * | qFunction, |
Policy * | policy, | ||
unsigned int | observationDim, | ||
ActionProperties * | actionProperties, | ||
float | lambda, | ||
float | gamma, | ||
bool | offPolicy = false |
||
) |
|
virtual |
|
virtual |
Performs the last episode step.
Reimplemented from Agent.
|
virtual |
Initializes the agent.
Reimplemented from Agent.
|
virtual |
Chooses the first action in the episode.
Implements Agent.
|
virtual |
Performs an episode step.
Implements Agent.
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.