bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType > Class Template Referencefinal

The Sarsa class. More...

#include <sarsa.h>

Inheritance diagram for bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >:
Collaboration diagram for bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >:

Public Types

typedef TDAlgoBase< EnvType >::env_type env_type
 env_t
typedef TDAlgoBase< EnvType >::action_type action_type
 action_t
typedef TDAlgoBase< EnvType >::state_type state_type
 state_t
typedef PolicyType policy_type
 action_selector_t
Public Types inherited from bitrl::rl::algos::td::TDAlgoBase< EnvType >
typedef EnvType env_type
 env_t
typedef env_type::action_type action_type
 action_t
typedef env_type::state_type state_type
 state_t
Public Types inherited from bitrl::rl::algos::RLSolverBase< EnvType >
typedef EnvType env_type

Public Member Functions

 SarsaSolver (SarsaConfig config, const PolicyType &selector)
 ExpectedSarsaSolver.
virtual void actions_before_training_begins (env_type &)
 actions_before_training_begins. Execute any actions the algorithm needs before starting the iterations
virtual void actions_after_training_ends (env_type &)
 actions_after_training_ends. Actions to execute after the training iterations have finisehd
virtual void actions_before_episode_begins (env_type &, uint_t)
 actions_before_training_episode
virtual void actions_after_episode_ends (env_type &, uint_t episode_idx, const EpisodeInfo &)
 actions_after_training_episode
virtual EpisodeInfo on_training_episode (env_type &, uint_t episode_idx)
 on_episode Do one on_episode of the algorithm
void save (const std::string &filename) const
 Build the policy after training.
bitrl::rl::policies::MaxTabularPolicy build_policy () const
 Build the policy after training.
Public Member Functions inherited from bitrl::rl::algos::td::TDAlgoBase< EnvType >
virtual ~TDAlgoBase ()=default
 Destructor.
Public Member Functions inherited from bitrl::rl::algos::RLSolverBase< EnvType >
virtual ~RLSolverBase ()=default
 Destructor.

Additional Inherited Members

Protected Member Functions inherited from bitrl::rl::algos::td::TDAlgoBase< EnvType >
 TDAlgoBase ()=default
 DPAlgoBase.
Protected Member Functions inherited from bitrl::rl::algos::RLSolverBase< EnvType >
 RLSolverBase ()=default
 Constructor.

Detailed Description

template<envs::discrete_world_concept EnvType, typename PolicyType>
class bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >

The Sarsa class.

Member Typedef Documentation

◆ action_type

template<envs::discrete_world_concept EnvType, typename PolicyType>
typedef TDAlgoBase<EnvType>::action_type bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::action_type

action_t

◆ env_type

template<envs::discrete_world_concept EnvType, typename PolicyType>
typedef TDAlgoBase<EnvType>::env_type bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::env_type

env_t

◆ policy_type

template<envs::discrete_world_concept EnvType, typename PolicyType>
typedef PolicyType bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::policy_type

action_selector_t

◆ state_type

template<envs::discrete_world_concept EnvType, typename PolicyType>
typedef TDAlgoBase<EnvType>::state_type bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::state_type

state_t

Constructor & Destructor Documentation

◆ SarsaSolver()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::SarsaSolver ( SarsaConfig config,
const PolicyType & selector )

Member Function Documentation

◆ actions_after_episode_ends()

template<envs::discrete_world_concept EnvType, typename PolicyType>
virtual void bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::actions_after_episode_ends ( env_type & ,
uint_t episode_idx,
const EpisodeInfo &  )
inlinevirtual

actions_after_training_episode

Reimplemented from bitrl::rl::algos::RLSolverBase< EnvType >.

◆ actions_after_training_ends()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
void bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::actions_after_training_ends ( env_type & )
virtual

actions_after_training_ends. Actions to execute after the training iterations have finisehd

Implements bitrl::rl::algos::RLSolverBase< EnvType >.

◆ actions_before_episode_begins()

template<envs::discrete_world_concept EnvType, typename PolicyType>
virtual void bitrl::rl::algos::td::SarsaSolver< EnvType, PolicyType >::actions_before_episode_begins ( env_type & ,
uint_t  )
inlinevirtual

actions_before_training_episode

Reimplemented from bitrl::rl::algos::RLSolverBase< EnvType >.

◆ actions_before_training_begins()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
void bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::actions_before_training_begins ( env_type & env)
virtual

actions_before_training_begins. Execute any actions the algorithm needs before starting the iterations

Implements bitrl::rl::algos::RLSolverBase< EnvType >.

◆ build_policy()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
bitrl::rl::policies::MaxTabularPolicy bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::build_policy ( ) const

Build the policy after training.

◆ on_training_episode()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
EpisodeInfo bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::on_training_episode ( env_type & env,
uint_t episode_idx )
virtual

on_episode Do one on_episode of the algorithm

Implements bitrl::rl::algos::RLSolverBase< EnvType >.

◆ save()

template<envs::discrete_world_concept EnvTp, typename PolicyType>
void bitrl::rl::algos::td::SarsaSolver< EnvTp, PolicyType >::save ( const std::string & filename) const

Build the policy after training.


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