MultiAgentDecisionProcess
RewardModelTOISparse Class Reference

RewardModelTOISparse represents a discrete reward model based on vectors of states and actions. More...

#include <RewardModelTOISparse.h>

Public Member Functions

double Get (const std::vector< Index > &sIs, const std::vector< Index > &aIs) const
 Returns R(s,ja) More...
 
void Print () const
 Print this to cout. More...
 
 RewardModelTOISparse (const std::string &s_str="s", const std::string &ja_str="ja")
 default Constructor nrS - number of states nrJA - number of joint actions s_str - how to call a state (For example you can use this class to create a mapping from observation histories and ja's to reals. More...
 
void Set (const std::vector< Index > &sIs, const std::vector< Index > &aIs, double reward)
 Sets R(s_i,ja_i) More...
 
std::string SoftPrint () const
 Prints a description of this to a string. More...
 
 ~RewardModelTOISparse ()
 Copy constructor. More...
 

Private Attributes

std::string _m_ja_str
 
std::map< std::pair
< std::vector< Index >
, std::vector< Index >
>, double > 
_m_R
 
std::string _m_s_str
 

Detailed Description

RewardModelTOISparse represents a discrete reward model based on vectors of states and actions.

Constructor & Destructor Documentation

RewardModelTOISparse::RewardModelTOISparse ( const std::string &  s_str = "s",
const std::string &  ja_str = "ja" 
)

default Constructor nrS - number of states nrJA - number of joint actions s_str - how to call a state (For example you can use this class to create a mapping from observation histories and ja's to reals.

Then this argument could be "joh") ja_str - idem for the joint actions

RewardModelTOISparse::~RewardModelTOISparse ( )

Copy constructor.

Destructor.

Member Function Documentation

double RewardModelTOISparse::Get ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs 
) const
void RewardModelTOISparse::Print ( ) const
inline

Print this to cout.

References SoftPrint().

void RewardModelTOISparse::Set ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs,
double  reward 
)

Sets R(s_i,ja_i)

Index ja_i, Index s_i, are indices of the state and taken joint action. r is the reward. The order of events is s, ja, so is the arg. list.

Referenced by TOIDecPOMDPDiscrete::SetReward().

string RewardModelTOISparse::SoftPrint ( ) const

Prints a description of this to a string.

Referenced by Print(), and TOIDecPOMDPDiscrete::SoftPrint().

Member Data Documentation

std::string RewardModelTOISparse::_m_ja_str
private
std::map<std::pair<std::vector<Index>, std::vector<Index> >, double> RewardModelTOISparse::_m_R
private
std::string RewardModelTOISparse::_m_s_str
private