CRAAM  2.0.0
Robust and Approximate Markov Decision Processes
Public Types | Public Member Functions | Protected Attributes | List of all members
craam::msen::RandomizedPolicy< Sim > Class Template Reference

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
 

Detailed Description

template<typename Sim>
class craam::msen::RandomizedPolicy< Sim >

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.

Constructor & Destructor Documentation

◆ RandomizedPolicy()

template<typename Sim >
craam::msen::RandomizedPolicy< Sim >::RandomizedPolicy ( const Sim &  sim,
const vector< numvec > &  probabilities,
random_device::result_type  seed = random_device{}() 
)
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)

Parameters
simSimulator used with the policy. The reference is retained, the object should not be deleted
probabilitiesList of action probabilities for each state

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