MultiAgentDecisionProcess  Release 0.2.1
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:
+ Collaboration diagram for ValueFunctionDecPOMDPDiscrete:

Public Member Functions

double CalculateV (bool cache=true)
 Calculates the value function, which is stored and returns V(0).
 ValueFunctionDecPOMDPDiscrete (PlanningUnitDecPOMDPDiscrete &p, JointPolicyDiscretePure &jp)
 Constructor.
 ValueFunctionDecPOMDPDiscrete (PlanningUnitDecPOMDPDiscrete *p, JointPolicyDiscretePure *jp)
 Constructor.
 ValueFunctionDecPOMDPDiscrete (const ValueFunctionDecPOMDPDiscrete &a)
 Copy constructor.
 ~ValueFunctionDecPOMDPDiscrete ()
 Destructor.
- Public Member Functions inherited from ValueFunction
virtual PlanningUnitGetPU () const =0
 Return a reference to the planning unit.
virtual ~ValueFunction ()
 Destructor.
- Public Member Functions inherited from Referrer< PlanningUnitDecPOMDPDiscrete >
PlanningUnitDecPOMDPDiscreteGetReferred () const
 Return the referred thing...
 Referrer (PlanningUnitDecPOMDPDiscrete *t_p=0)
 (default) Constructor
 Referrer (PlanningUnitDecPOMDPDiscrete &t)
 Alternative constructor.
 Referrer (const Referrer &a)
 Copy constructor.
void SetReferred (PlanningUnitDecPOMDPDiscrete *t_p)
 Change the referred thing...
virtual ~Referrer ()
 Destructor.
- Public Member Functions inherited from Referrer< JointPolicyDiscretePure >
JointPolicyDiscretePureGetReferred () const
 Return the referred thing...
 Referrer (JointPolicyDiscretePure *t_p=0)
 (default) Constructor
 Referrer (JointPolicyDiscretePure &t)
 Alternative constructor.
 Referrer (const Referrer &a)
 Copy constructor.
void SetReferred (JointPolicyDiscretePure *t_p)
 Change the referred thing...
virtual ~Referrer ()
 Destructor.

Private Types

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

Private Member Functions

double CalculateV0RecursivelyCached ()
double CalculateV0RecursivelyNotCached ()
double CalculateVsjohRecursivelyCached (Index sI, Index johI, Index stage)
 Function used by CalculateV0Recursively.
double CalculateVsjohRecursivelyNotCached (Index sI, Index johI, Index stage)
 Function used by CalculateV0Recursively.
void CreateV ()
 Creates a brand new value function (deleting the current one if it exists).
void DeleteV ()
 Deletes the current value function.
Index GetCombinedIndex (Index sI, Index JOHI) const
JointPolicyDiscretePureGetJPol () const
PlanningUnitDecPOMDPDiscreteGetPU () const
bool IsCached (Index sI, Index JOHI)
void SetCached (Index sI, Index JOHI)

Private Attributes

std::map< Index, bool > _m_cached
size_t _m_h
JointPolicyDiscretePure_m_jpol
size_t _m_nrJO
size_t _m_nrJOH
size_t _m_nrS
Matrix_m_p_V
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.

Definition at line 45 of file ValueFunctionDecPOMDPDiscrete.h.

Member Typedef Documentation

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

Definition at line 60 of file ValueFunctionDecPOMDPDiscrete.h.

Constructor & Destructor Documentation

ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete ( const ValueFunctionDecPOMDPDiscrete a)

Copy constructor.

Definition at line 67 of file ValueFunctionDecPOMDPDiscrete.cpp.

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

ValueFunctionDecPOMDPDiscrete::~ValueFunctionDecPOMDPDiscrete ( )

Destructor.

Definition at line 78 of file ValueFunctionDecPOMDPDiscrete.cpp.

References DeleteV().

Member Function Documentation

double ValueFunctionDecPOMDPDiscrete::CalculateV ( bool  cache = true)

Calculates the value function, which is stored and returns V(0).

Definition at line 118 of file ValueFunctionDecPOMDPDiscrete.cpp.

References CalculateV0RecursivelyCached(), and CalculateV0RecursivelyNotCached().

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

double ValueFunctionDecPOMDPDiscrete::CalculateV0RecursivelyCached ( )
private
double ValueFunctionDecPOMDPDiscrete::CalculateV0RecursivelyNotCached ( )
private
double ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyCached ( Index  sI,
Index  johI,
Index  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.

Definition at line 185 of file ValueFunctionDecPOMDPDiscrete.cpp.

References _m_h, _m_nrJO, _m_nrS, _m_p_V, _m_pu, DEBUG_CALCV, DEBUG_CALCV_CACHE, JointPolicyDiscretePure::GetJointActionIndex(), GetJPol(), PlanningUnitMADPDiscrete::GetObservationProbability(), PlanningUnitDecPOMDPDiscrete::GetReward(), PlanningUnitMADPDiscrete::GetSuccessorJOHI(), PlanningUnitMADPDiscrete::GetTransitionProbability(), IsCached(), and SetCached().

Referenced by CalculateV0RecursivelyCached().

double ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyNotCached ( Index  sI,
Index  johI,
Index  stage 
)
private
void ValueFunctionDecPOMDPDiscrete::CreateV ( )
private

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

Definition at line 93 of file ValueFunctionDecPOMDPDiscrete.cpp.

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

Referenced by CalculateV0RecursivelyCached().

void ValueFunctionDecPOMDPDiscrete::DeleteV ( )
private

Deletes the current value function.

Definition at line 83 of file ValueFunctionDecPOMDPDiscrete.cpp.

References _m_cached, _m_p_V, and _m_V_initialized.

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

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

Definition at line 65 of file ValueFunctionDecPOMDPDiscrete.h.

References _m_nrJOH.

Referenced by IsCached(), and SetCached().

JointPolicyDiscretePure* ValueFunctionDecPOMDPDiscrete::GetJPol ( ) const
inlineprivate
PlanningUnitDecPOMDPDiscrete* ValueFunctionDecPOMDPDiscrete::GetPU ( ) const
inlineprivate

Definition at line 79 of file ValueFunctionDecPOMDPDiscrete.h.

References _m_pu.

Referenced by CalculateVsjohRecursivelyNotCached().

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

Definition at line 68 of file ValueFunctionDecPOMDPDiscrete.h.

References _m_cached, and GetCombinedIndex().

Referenced by CalculateVsjohRecursivelyCached().

void ValueFunctionDecPOMDPDiscrete::SetCached ( Index  sI,
Index  JOHI 
)
private

Definition at line 105 of file ValueFunctionDecPOMDPDiscrete.cpp.

References _m_cached, and GetCombinedIndex().

Referenced by CalculateVsjohRecursivelyCached().

Member Data Documentation

std::map<Index, bool> ValueFunctionDecPOMDPDiscrete::_m_cached
private

Definition at line 63 of file ValueFunctionDecPOMDPDiscrete.h.

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

size_t ValueFunctionDecPOMDPDiscrete::_m_h
private
JointPolicyDiscretePure* ValueFunctionDecPOMDPDiscrete::_m_jpol
private

Definition at line 52 of file ValueFunctionDecPOMDPDiscrete.h.

Referenced by GetJPol(), and ValueFunctionDecPOMDPDiscrete().

size_t ValueFunctionDecPOMDPDiscrete::_m_nrJO
private
size_t ValueFunctionDecPOMDPDiscrete::_m_nrJOH
private
Matrix* ValueFunctionDecPOMDPDiscrete::_m_p_V
private
bool ValueFunctionDecPOMDPDiscrete::_m_V_initialized
private

Definition at line 59 of file ValueFunctionDecPOMDPDiscrete.h.

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


The documentation for this class was generated from the following files: