From c40aab7b57de3ce6ea6eee4a2b2875e96bef8956 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sun, 28 Apr 2019 14:30:54 +0530 Subject: [PATCH] Added accessors for state and environment --- .../methods/reinforcement_learning/q_learning.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mlpack/methods/reinforcement_learning/q_learning.hpp b/src/mlpack/methods/reinforcement_learning/q_learning.hpp index 9332c67e39..04eb47babd 100644 --- a/src/mlpack/methods/reinforcement_learning/q_learning.hpp +++ b/src/mlpack/methods/reinforcement_learning/q_learning.hpp @@ -100,6 +100,16 @@ class QLearning */ const size_t& TotalSteps() const { return totalSteps; } + //! Modify the state of the agent. + StateType& State() { return state; } + //! Get the state of the agent. + const StateType& State() const { return state; } + + //! Modify the environment in which the agent is. + EnvironmentType& Environment() { return environment; } + //! Get the environment in which the agent is. + const EnvironmentType& Environment() const { return environment; } + //! Modify the training mode / test mode indicator. bool& Deterministic() { return deterministic; } //! Get the indicator of training mode / test mode.