MultiAgentDecisionProcess
RewardModelMappingSparseMapped Class Reference

RewardModelMappingSparseMapped represents a discrete reward model. More...

#include <RewardModelMappingSparseMapped.h>

Inheritance diagram for RewardModelMappingSparseMapped:
[legend]

Public Member Functions

virtual
RewardModelMappingSparseMapped
Clone () const
 Returns a pointer to a copy of this class. More...
 
double Get (Index s_i, Index ja_i) const
 Returns R(s,ja) More...
 
 RewardModelMappingSparseMapped (size_t nrS=1, size_t nrJA=1, 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 (Index s_i, Index ja_i, double rew)
 Sets R(s_i,ja_i) More...
 
std::string SoftPrint () const
 Prints a description of this to a string. More...
 
 ~RewardModelMappingSparseMapped ()
 Copy constructor. More...
 
- Public Member Functions inherited from RewardModel
size_t GetNrJointActions () const
 
size_t GetNrStates () const
 
 RewardModel (size_t nrS=1, size_t nrJA=1)
 default Constructor More...
 
virtual ~RewardModel ()
 Destructor. More...
 
- Public Member Functions inherited from RewardModelDiscreteInterface
void Print () const
 Print this to cout. More...
 
 RewardModelDiscreteInterface ()
 default Constructor More...
 
virtual ~RewardModelDiscreteInterface ()
 Destructor. More...
 
- Public Member Functions inherited from QTableInterface
virtual ~QTableInterface ()
 

Private Types

typedef
boost::numeric::ublas::mapped_matrix
< double > 
SparseMatrix
 

Private Attributes

std::string _m_ja_str
 
SparseMatrix _m_R
 
std::string _m_s_str
 

Friends

class RGet_RewardModelMappingSparseMapped
 

Detailed Description

RewardModelMappingSparseMapped represents a discrete reward model.

This version uses a mapped matrix as sparse representation.

Member Typedef Documentation

typedef boost::numeric::ublas::mapped_matrix<double> RewardModelMappingSparseMapped::SparseMatrix
private

Constructor & Destructor Documentation

RewardModelMappingSparseMapped::RewardModelMappingSparseMapped ( size_t  nrS = 1,
size_t  nrJA = 1,
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

References _m_ja_str, and _m_s_str.

Referenced by Clone().

RewardModelMappingSparseMapped::~RewardModelMappingSparseMapped ( )

Copy constructor.

Destructor.

Member Function Documentation

virtual RewardModelMappingSparseMapped* RewardModelMappingSparseMapped::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements RewardModelDiscreteInterface.

References RewardModelMappingSparseMapped().

double RewardModelMappingSparseMapped::Get ( Index  s_i,
Index  ja_i 
) const
inlinevirtual

Returns R(s,ja)

Implements RewardModelDiscreteInterface.

References _m_R.

Referenced by SoftPrint().

void RewardModelMappingSparseMapped::Set ( Index  s_i,
Index  ja_i,
double  rew 
)
inlinevirtual

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.

Implements RewardModelDiscreteInterface.

References _m_R, and Globals::REWARD_PRECISION.

string RewardModelMappingSparseMapped::SoftPrint ( ) const
virtual

Prints a description of this to a string.

Implements RewardModelDiscreteInterface.

References _m_ja_str, _m_s_str, Get(), RewardModel::GetNrJointActions(), and RewardModel::GetNrStates().

Friends And Related Function Documentation

friend class RGet_RewardModelMappingSparseMapped
friend

Member Data Documentation

std::string RewardModelMappingSparseMapped::_m_ja_str
private
SparseMatrix RewardModelMappingSparseMapped::_m_R
private

Referenced by Get(), and Set().

std::string RewardModelMappingSparseMapped::_m_s_str
private