|
CRAAM
2.0.0
Robust and Approximate Markov Decision Processes
|
A randomized policy that chooses actions according to the provided vector of probabilities. More...
#include <Simulation.hpp>
Public Types | |
| using | State = typename Sim::State |
| using | Action = typename Sim::Action |
Public Member Functions | |
| RandomizedPolicy (const Sim &sim, const vector< numvec > &probabilities, random_device::result_type seed=random_device{}()) | |
| Initializes randomized polices, transition probabilities for each state. More... | |
| Action | operator() (State state) |
| Returns a random action. | |
Protected Attributes | |
| default_random_engine | gen |
| Random number engine. | |
| vector< discrete_distribution< long > > | distributions |
| List of discrete distributions for all states. | |
| const Sim & | sim |
| simulator reference | |
A randomized policy that chooses actions according to the provided vector of probabilities.
Action probabilities must sum to one for each state.
State must be convertible to a long index; that is must support (explicit) operator long Actions also have to be indexed. See the definition of simulate.
|
inline |
Initializes randomized polices, transition probabilities for each state.
The policy is applicable only to simulators that have:
1) At most as many states as probabilities.size() 2) At least as many actions are max(probabilities[i].size() | i)
| sim | Simulator used with the policy. The reference is retained, the object should not be deleted |
| probabilities | List of action probabilities for each state |
1.8.13