#include <RMaxModel.hh>
Classes | |
struct | state_info |
Public Member Functions | |
virtual RMaxModel * | getCopy () |
virtual float | getStateActionInfo (const std::vector< float > &state, int act, StateActionInfo *retval) |
RMaxModel (int m, int nact, Random rng) | |
RMaxModel (const RMaxModel &) | |
virtual bool | updateWithExperience (experience &e) |
virtual bool | updateWithExperiences (std::vector< experience > &instances) |
virtual | ~RMaxModel () |
Protected Types | |
typedef const std::vector < float > * | state_t |
Protected Member Functions | |
state_t | canonicalize (const std::vector< float > &s) |
void | checkTransitionCountSize (std::vector< int > *transCounts) |
void | initNewState (state_t s) |
void | initStateInfo (state_info *info) |
Private Attributes | |
int | M |
int | nact |
int | nstates |
bool | RMAX_DEBUG |
Random | rng |
std::map< state_t, state_info > | statedata |
std::set< std::vector< float > > | statespace |
MDPModel used for RMax. Tabular model with Maximum Likelihood model for each state-action.
Definition at line 17 of file RMaxModel.hh.
typedef const std::vector<float>* RMaxModel::state_t [protected] |
Definition at line 62 of file RMaxModel.hh.
RMaxModel::RMaxModel | ( | int | m, |
int | nact, | ||
Random | rng | ||
) |
Default constructor
m | # of visits before a state-actions becomes known. |
nact | # of actions in the domain |
rng | Random Number Generator |
Definition at line 11 of file RMaxModel.cc.
RMaxModel::RMaxModel | ( | const RMaxModel & | rm | ) |
Copy constructor
Definition at line 20 of file RMaxModel.cc.
RMaxModel::~RMaxModel | ( | ) | [virtual] |
Definition at line 46 of file RMaxModel.cc.
RMaxModel::state_t RMaxModel::canonicalize | ( | const std::vector< float > & | s | ) | [protected] |
Add the given state to the state set. initializes state info for new states not yet in set. The pointer to the state in the set is used for map of state_info's
Definition at line 184 of file RMaxModel.cc.
void RMaxModel::checkTransitionCountSize | ( | std::vector< int > * | transCounts | ) | [protected] |
Make sure the transition count vector is sized properly before indexing into it.
Definition at line 229 of file RMaxModel.cc.
RMaxModel * RMaxModel::getCopy | ( | ) | [virtual] |
Implements MDPModel.
Definition at line 41 of file RMaxModel.cc.
float RMaxModel::getStateActionInfo | ( | const std::vector< float > & | state, |
int | act, | ||
StateActionInfo * | retval | ||
) | [virtual] |
Implements MDPModel.
Definition at line 116 of file RMaxModel.cc.
void RMaxModel::initNewState | ( | state_t | s | ) | [protected] |
Initialize a new state
Definition at line 202 of file RMaxModel.cc.
void RMaxModel::initStateInfo | ( | state_info * | info | ) | [protected] |
Initialize a state_info struct
Definition at line 214 of file RMaxModel.cc.
bool RMaxModel::updateWithExperience | ( | experience & | e | ) | [virtual] |
Implements MDPModel.
Definition at line 63 of file RMaxModel.cc.
bool RMaxModel::updateWithExperiences | ( | std::vector< experience > & | instances | ) | [virtual] |
Implements MDPModel.
Definition at line 49 of file RMaxModel.cc.
int RMaxModel::M [private] |
Definition at line 92 of file RMaxModel.hh.
int RMaxModel::nact [private] |
Definition at line 93 of file RMaxModel.hh.
int RMaxModel::nstates [private] |
Definition at line 90 of file RMaxModel.hh.
bool RMaxModel::RMAX_DEBUG [private] |
Definition at line 96 of file RMaxModel.hh.
Random RMaxModel::rng [private] |
Definition at line 94 of file RMaxModel.hh.
std::map<state_t, state_info> RMaxModel::statedata [private] |
Hashmap mapping state vectors to their state_info structs.
Definition at line 88 of file RMaxModel.hh.
std::set<std::vector<float> > RMaxModel::statespace [private] |
Set of all distinct sensations seen. Pointers to elements of this set serve as the internal representation of the environment state.
Definition at line 85 of file RMaxModel.hh.