MultiAgentDecisionProcess
ValueFunctionDecPOMDPDiscrete Class Reference

ValueFunctionDecPOMDPDiscrete represents and calculates the value function of a (pure) joint policy for a discrete Dec-POMDP. More...

#include <ValueFunctionDecPOMDPDiscrete.h>

Inheritance diagram for ValueFunctionDecPOMDPDiscrete:
[legend]

Public Member Functions

template<bool CACHED>
double CalculateV ()
 Calculates the value function, which is stored and returns V(0). call with "CalculateV<true>()" for the cached version or call with "CalculateV<false>()" for the non-cached version. More...
 
 ValueFunctionDecPOMDPDiscrete (PlanningUnitDecPOMDPDiscrete &p, JointPolicyDiscretePure &jp)
 Constructor. More...
 
 ValueFunctionDecPOMDPDiscrete (PlanningUnitDecPOMDPDiscrete *p, JointPolicyDiscretePure *jp)
 Constructor. More...
 
 ValueFunctionDecPOMDPDiscrete (const ValueFunctionDecPOMDPDiscrete &a)
 Copy constructor. More...
 
 ~ValueFunctionDecPOMDPDiscrete ()
 Destructor. More...
 
- Public Member Functions inherited from ValueFunction
virtual ~ValueFunction ()
 Destructor. More...
 

Private Types

typedef
boost::numeric::ublas::matrix
< double > 
Matrix
 

Private Member Functions

template<bool CACHED>
double CalculateVsjohRecursively (Index sI, Index johI, unsigned int stage)
 Function used by CalculateV0Recursively. More...
 
double CalculateVsjohRecursively_cached (Index sI, Index johI, unsigned int stage)
 Wraps and adds caching to method CalculateVsjohRecursively() More...
 
void CreateV ()
 Creates a brand new value function (deleting the current one if it exists). More...
 
void DeleteV ()
 Deletes the current value function. More...
 
Index GetCombinedIndex (Index sI, Index JOHI) const
 
JointPolicyDiscretePureGetJPol () const
 
PlanningUnitDecPOMDPDiscreteGetPU () const
 Return a reference to the planning unit. More...
 
bool IsCached (Index sI, Index JOHI)
 
void SetCached (Index sI, Index JOHI)
 

Private Attributes

std::set< Index_m_cached
 
size_t _m_h
 
JointPolicyDiscretePure_m_jointPolicyDiscretePure
 
JointPolicyDiscretePure_m_jpol
 
size_t _m_nrJO
 
size_t _m_nrJOH
 
size_t _m_nrS
 
Matrix_m_p_V
 
PlanningUnitDecPOMDPDiscrete_m_planningUnitDecPOMDPDiscrete
 
PlanningUnitDecPOMDPDiscrete_m_pu
 
bool _m_V_initialized
 

Detailed Description

ValueFunctionDecPOMDPDiscrete represents and calculates the value function of a (pure) joint policy for a discrete Dec-POMDP.

Member Typedef Documentation

typedef boost::numeric::ublas::matrix<double> ValueFunctionDecPOMDPDiscrete::Matrix
private

Constructor & Destructor Documentation

ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete ( const ValueFunctionDecPOMDPDiscrete a)

Copy constructor.

References _m_jpol, _m_nrJOH, _m_p_V, _m_pu, and _m_V_initialized.

ValueFunctionDecPOMDPDiscrete::~ValueFunctionDecPOMDPDiscrete ( )

Destructor.

References DeleteV().

Member Function Documentation

template<bool CACHED>
template double ValueFunctionDecPOMDPDiscrete::CalculateV< false > ( )

Calculates the value function, which is stored and returns V(0). call with "CalculateV<true>()" for the cached version or call with "CalculateV<false>()" for the non-cached version.

References _m_nrS, _m_pu, CalculateVsjohRecursively_cached(), CreateV(), PlanningUnitMADPDiscrete::GetInitialStateProbability(), GetJPol(), Globals::INITIAL_JOHI, and JointPolicy::Print().

Referenced by JESPExhaustivePlanner::ExhaustiveBestResponse(), BruteForceSearchPlanner::Plan(), and DICEPSPlanner::Plan().

template<bool CACHED>
double ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursively ( Index  sI,
Index  johI,
unsigned int  stage 
)
private

Function used by CalculateV0Recursively.

This recursively Calculates the expected payoff of the joint policy starting from state sI and joint observation history johI.

References _m_h, _m_nrJO, _m_nrS, _m_pu, CalculateVsjohRecursively_cached(), JointPolicyDiscretePure::GetJointActionIndex(), GetJPol(), PlanningUnitMADPDiscrete::GetObservationProbability(), PlanningUnitDecPOMDPDiscrete::GetReward(), PlanningUnitMADPDiscrete::GetSuccessorJOHI(), and PlanningUnitMADPDiscrete::GetTransitionProbability().

double ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursively_cached ( Index  sI,
Index  johI,
unsigned int  stage 
)
inlineprivate

Wraps and adds caching to method CalculateVsjohRecursively()

References _m_p_V, IsCached(), and SetCached().

Referenced by CalculateV(), and CalculateVsjohRecursively().

void ValueFunctionDecPOMDPDiscrete::CreateV ( )
private

Creates a brand new value function (deleting the current one if it exists).

References _m_nrJOH, _m_nrS, _m_p_V, _m_V_initialized, and DeleteV().

Referenced by CalculateV().

void ValueFunctionDecPOMDPDiscrete::DeleteV ( )
private

Deletes the current value function.

References _m_cached, _m_p_V, and _m_V_initialized.

Referenced by CreateV(), and ~ValueFunctionDecPOMDPDiscrete().

Index ValueFunctionDecPOMDPDiscrete::GetCombinedIndex ( Index  sI,
Index  JOHI 
) const
inlineprivate

Referenced by IsCached(), and SetCached().

JointPolicyDiscretePure* ValueFunctionDecPOMDPDiscrete::GetJPol ( ) const
inlineprivate

References _m_jpol.

Referenced by CalculateV(), and CalculateVsjohRecursively().

PlanningUnitDecPOMDPDiscrete* ValueFunctionDecPOMDPDiscrete::GetPU ( ) const
inlineprivatevirtual

Return a reference to the planning unit.

Implements ValueFunction.

References _m_pu.

bool ValueFunctionDecPOMDPDiscrete::IsCached ( Index  sI,
Index  JOHI 
)
inlineprivate
void ValueFunctionDecPOMDPDiscrete::SetCached ( Index  sI,
Index  JOHI 
)
inlineprivate

Member Data Documentation

std::set<Index> ValueFunctionDecPOMDPDiscrete::_m_cached
private

Referenced by DeleteV(), IsCached(), and SetCached().

size_t ValueFunctionDecPOMDPDiscrete::_m_h
private
JointPolicyDiscretePure* ValueFunctionDecPOMDPDiscrete::_m_jointPolicyDiscretePure
private
JointPolicyDiscretePure* ValueFunctionDecPOMDPDiscrete::_m_jpol
private
size_t ValueFunctionDecPOMDPDiscrete::_m_nrJO
private
size_t ValueFunctionDecPOMDPDiscrete::_m_nrJOH
private
size_t ValueFunctionDecPOMDPDiscrete::_m_nrS
private
Matrix* ValueFunctionDecPOMDPDiscrete::_m_p_V
private
PlanningUnitDecPOMDPDiscrete* ValueFunctionDecPOMDPDiscrete::_m_planningUnitDecPOMDPDiscrete
private
PlanningUnitDecPOMDPDiscrete* ValueFunctionDecPOMDPDiscrete::_m_pu
private
bool ValueFunctionDecPOMDPDiscrete::_m_V_initialized
private