class MaxTabularPolicy
More...
#include <max_tabular_policy.h>
|
| template<typename VecTp> |
| MaxTabularPolicy::action_type | get_action (const VecTp &vec) |
| | MaxTabularPolicy ()=default |
| | Constructor.
|
| void | on_episode (uint_t) noexcept |
| | any actions the policy should perform on the given episode index
|
| void | reset () noexcept |
| | Reset the policy.
|
| action_type | on_state (state_type s) const |
| | Get the action from the given state.
|
| void | save (const std::string &filename) const |
| | Save the state -> action map in a CSV file;.
|
| void | load (const std::string &filename) |
| | Load the state -> action map from a CSV file that save() wrote: a state and its action per row, and lines that start with # ignored. The states must be 0, 1, 2, ... in order.
|
| uint_t | n_states () const noexcept |
| | The number of states the policy has an action for.
|
|
| template<typename MatType> |
| static output_type | get_action (const MatType &q_map, uint_t state_idx) |
| | get_action. Given a
|
| template<typename VecTp> |
| static output_type | get_action (const VecTp &q_map) |
| | get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
|
| static output_type | get_action (const torch_tensor_t &vec) |
| | get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
|
◆ action_type
◆ output_type
The output type of operator().
◆ state_type
◆ MaxTabularPolicy()
◆ get_action() [1/4]
template<typename MatType>
◆ get_action() [2/4]
get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
◆ get_action() [3/4]
get_action. Given a vector always returns the position of the maximum occuring element. If the given vector is empty returns CubeAIConsts::invalid_size_type
◆ get_action() [4/4]
◆ load()
Load the state -> action map from a CSV file that save() wrote: a state and its action per row, and lines that start with # ignored. The states must be 0, 1, 2, ... in order.
- Exceptions
-
| std::runtime_error | if the file cannot be read or is not like that |
◆ n_states()
The number of states the policy has an action for.
◆ on_episode()
any actions the policy should perform on the given episode index
◆ on_state()
Get the action from the given state.
◆ reset()
◆ save()
Save the state -> action map in a CSV file;.
◆ MaxTabularPolicyBuilder
| friend struct MaxTabularPolicyBuilder |
|
friend |
Make friends so the builder access private members.
The documentation for this class was generated from the following file: