MultiAgentDecisionProcess
AlphaVector Class Reference

AlphaVector represent an alpha vector used in POMDP solving. More...

#include <AlphaVector.h>

Public Types

typedef long long int BGPolicyIndex
 

Public Member Functions

AlphaVector Add (const AlphaVector &B) const
 Add B to this and return as a new vector. More...
 
 AlphaVector ()
 Default constructor. More...
 
 AlphaVector (size_t nrS)
 Constructor that reserves memory for nrS values. More...
 
 AlphaVector (size_t nrS, double val)
 Constructor that reserves memory for nrS values, and sets every value to val. More...
 
bool Equal (const AlphaVector &alpha) const
 Compare whether this alpha vector is equal to alpha. More...
 
bool EqualValues (const AlphaVector &alpha) const
 Compare whether this alpha vector's values are equal to those of alpha. More...
 
Index GetAction () const
 Get the action index of this alpha vector. More...
 
BGPolicyIndex GetBetaI () const
 Get the Bayesian-Game-policy index of this alpha vector. More...
 
unsigned int GetNrValues () const
 Get the number of values represented by this alpha vector (state space size). More...
 
double GetValue (Index i) const
 Get the value for a particular state index i. More...
 
const std::vector< double > & GetValues () const
 Get a reference to the values this alpha vector contains. More...
 
void IAdd (const AlphaVector &B)
 Add B to this (in place Add) More...
 
AlphaVectoroperator= (const AlphaVector &o)
 Copy assignment operator. More...
 
void Print () const
 Print out a textual representation of this alpha vector. More...
 
void SetAction (Index a)
 Set the action index this alpha vector represents to a. More...
 
void SetBetaI (BGPolicyIndex betaI)
 Set the Bayesian-Game-policy index to betaI. More...
 
void SetValue (double v, Index i)
 Set the value for state i to value v. More...
 
void SetValues (const std::vector< double > &vs)
 Set the values over the state-space this alpha vector represents to vs. More...
 
std::string SoftPrint () const
 Get a textual representation of this alpha vector. More...
 
 ~AlphaVector ()
 Destructor. More...
 

Private Attributes

Index _m_action
 
BGPolicyIndex _m_betaI
 
std::vector< double > _m_values
 

Friends

std::ostream & operator<< (std::ostream &o, const AlphaVector &v)
 

Detailed Description

AlphaVector represent an alpha vector used in POMDP solving.

It's basically a vector of values and an action index.

Member Typedef Documentation

typedef long long int AlphaVector::BGPolicyIndex

Constructor & Destructor Documentation

AlphaVector::AlphaVector ( )

Default constructor.

AlphaVector::AlphaVector ( size_t  nrS)

Constructor that reserves memory for nrS values.

AlphaVector::AlphaVector ( size_t  nrS,
double  val 
)

Constructor that reserves memory for nrS values, and sets every value to val.

AlphaVector::~AlphaVector ( )

Destructor.

Member Function Documentation

AlphaVector AlphaVector::Add ( const AlphaVector B) const

Add B to this and return as a new vector.

References IAdd().

bool AlphaVector::Equal ( const AlphaVector alpha) const

Compare whether this alpha vector is equal to alpha.

References GetAction(), and GetBetaI().

Referenced by AlphaVectorBG::BeliefBackup(), AlphaVectorPruning::Contains(), and AlphaVectorPruning::RemoveFirstOccurrence().

bool AlphaVector::EqualValues ( const AlphaVector alpha) const

Compare whether this alpha vector's values are equal to those of alpha.

References GetNrValues(), and GetValues().

Index AlphaVector::GetAction ( ) const
inline

Get the action index of this alpha vector.

Referenced by QBGPlanner_TreeIncPruneBnB::BackupStage(), Equal(), and AlphaVectorPlanning::VectorIsInValueFunction().

BGPolicyIndex AlphaVector::GetBetaI ( ) const
inline

Get the Bayesian-Game-policy index of this alpha vector.

Referenced by AlphaVectorWeighted::BeliefBackup(), Equal(), and AlphaVectorPlanning::ImportValueFunction().

const std::vector<double>& AlphaVector::GetValues ( ) const
inline
void AlphaVector::IAdd ( const AlphaVector B)

Add B to this (in place Add)

Add B to this and return as a new vector.

References _m_values, and GetNrValues().

Referenced by Add().

AlphaVector & AlphaVector::operator= ( const AlphaVector o)

Copy assignment operator.

References _m_action, _m_betaI, and _m_values.

void AlphaVector::Print ( ) const
inline

Print out a textual representation of this alpha vector.

References SoftPrint().

Referenced by PerseusPOMDPPlanner::BackupStage().

void AlphaVector::SetValues ( const std::vector< double > &  vs)

Set the values over the state-space this alpha vector represents to vs.

Referenced by QBGPlanner_TreeIncPruneBnB::BackupStage(), AlphaVectorWeighted::BeliefBackup(), and AlphaVectorPlanning::ImportValueFunction().

string AlphaVector::SoftPrint ( void  ) const

Get a textual representation of this alpha vector.

Referenced by QAlphaVector::Initialize(), operator<<(), and Print().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const AlphaVector v 
)
friend

Member Data Documentation

Index AlphaVector::_m_action
private

Referenced by operator=().

BGPolicyIndex AlphaVector::_m_betaI
private

Referenced by operator=().

std::vector<double> AlphaVector::_m_values
private

Referenced by IAdd(), and operator=().