MultiAgentDecisionProcess
FSAOHDist_NECOF Class Reference

FSAOHDist_NECOF is a class that represents a NEarly COmpletely Factored distribution over state factors and action-observation histories. More...

#include <FSAOHDist_NECOF.h>

Inheritance diagram for FSAOHDist_NECOF:
[legend]

Public Member Functions

virtual
FactoredStateAOHDistribution
Clone () const
 
 FSAOHDist_NECOF ()
 Constructor without arguments, needed for serialization. More...
 
 FSAOHDist_NECOF (const PlanningUnitFactoredDecPOMDPDiscrete *p)
 (default) Constructor More...
 
 FSAOHDist_NECOF (const FSAOHDist_NECOF &a)
 Copy constructor. More...
 
virtual double GetAOHProb_relT (const Scope &agSc, const std::vector< Index > &aohI) const
 function that returns the prob. of the AOH of a subset of agents More...
 
virtual double GetOHProb_relT (const Scope &agSc, const std::vector< Index > &ohI) const
 
virtual double GetXOHProb_relT (const Scope &sfSc, const std::vector< Index > &sfacI, const Scope &agSc, const std::vector< Index > &ohI) const
 returns P(sfacI, ohI) More...
 
virtual double GetXOHProb_relT_SufficientSFscope (const Scope &sfSc, const std::vector< Index > &sfacI, const Scope &agSc, const std::vector< Index > &ohI) const
 returns P(sfacI, ohI) like GetXOHProb_relT. More...
 
virtual double GetXProb (const Scope &sfSc, const std::vector< Index > &sfValI) const
 
virtual void InitializeFromISD (const FactoredStateDistribution *d)
 
FSAOHDist_NECOFoperator= (const FSAOHDist_NECOF &o)
 Copy assignment operator. More...
 
virtual void SanityCheck ()
 
virtual std::string SoftPrint () const
 
virtual void Update (const JointPolicyDiscretePure &pol)
 Performs an update of the distribution to the next stage. More...
 
virtual ~FSAOHDist_NECOF ()
 Destructor. More...
 
- Public Member Functions inherited from FactoredStateAOHDistribution
virtual ~FactoredStateAOHDistribution ()
 Destructor. More...
 

Private Attributes

std::vector
< CPDDiscreteInterface * > 
_m_oHistConditional
 the conditional observation history probabilities More...
 
std::vector< std::vector
< double > > 
_m_oHistMarginals
 marginals of observation history probs for each agent More...
 
const
PlanningUnitFactoredDecPOMDPDiscrete
_m_puf
 
FSDist_COF_m_sfacMarginals
 the maintained state factor marginals More...
 
std::vector< Scope_m_sfacSoI
 the state factors in the scope of influence for each agent('s obs.) More...
 
std::vector< size_t > _m_sfacSoI_ii_size
 the number of influence instantiations for those scopes More...
 
Index _m_stage
 The stage for which this distribution is. More...
 
std::vector< size_t * > _m_stepsize
 the stepsize array (used to convert indiv<->joint indicies) is cached More...
 

Detailed Description

FSAOHDist_NECOF is a class that represents a NEarly COmpletely Factored distribution over state factors and action-observation histories.

This class assumes that the observations of different agents are independent given a,s'. i.e., that

\[ \Pr(o|a,s') = \prod_i \Pr(o_i|a,s') \]

Constructor & Destructor Documentation

FSAOHDist_NECOF::FSAOHDist_NECOF ( )

Constructor without arguments, needed for serialization.

Referenced by Clone().

FSAOHDist_NECOF::FSAOHDist_NECOF ( const FSAOHDist_NECOF a)
FSAOHDist_NECOF::~FSAOHDist_NECOF ( )
virtual

Destructor.

References _m_oHistConditional, _m_sfacMarginals, and _m_stepsize.

Member Function Documentation

virtual FactoredStateAOHDistribution* FSAOHDist_NECOF::Clone ( ) const
inlinevirtual
virtual double FSAOHDist_NECOF::GetAOHProb_relT ( const Scope agSc,
const std::vector< Index > &  aohI 
) const
inlinevirtual

function that returns the prob. of the AOH of a subset of agents

this function takes

  • agSC - the scope that specifies the subset of agents
  • aohI - a vector of indices of individual AOHs for each of the specified agents.

Note: relT indicates that the individual AOH indices are relative within the stage for which this distribution is.

Implements FactoredStateAOHDistribution.

double FSAOHDist_NECOF::GetOHProb_relT ( const Scope agSc,
const std::vector< Index > &  ohI 
) const
virtual
double FSAOHDist_NECOF::GetXOHProb_relT_SufficientSFscope ( const Scope sfSc,
const std::vector< Index > &  sfacI,
const Scope agSc,
const std::vector< Index > &  ohI 
) const
virtual

returns P(sfacI, ohI) like GetXOHProb_relT.

This version requires that sfSc is a superset of the scope of influence for all observations (of agents in agSc). I.e., this function will not perform any marginalization.

References _m_oHistConditional, _m_sfacSoI, _m_stepsize, GetXProb(), IndexTools::IndividualToJointIndicesStepSize(), and IndexTools::RestrictIndividualIndicesToNarrowerScope().

double FSAOHDist_NECOF::GetXProb ( const Scope sfSc,
const std::vector< Index > &  sfValI 
) const
virtual
void FSAOHDist_NECOF::InitializeFromISD ( const FactoredStateDistribution d)
virtual
FSAOHDist_NECOF & FSAOHDist_NECOF::operator= ( const FSAOHDist_NECOF o)

Copy assignment operator.

void FSAOHDist_NECOF::SanityCheck ( void  )
virtual
string FSAOHDist_NECOF::SoftPrint ( ) const
virtual
void FSAOHDist_NECOF::Update ( const JointPolicyDiscretePure pol)
virtual

Performs an update of the distribution to the next stage.

In particular this function computes the new

  • state factor marginals
  • OH conditionals
  • OH marginals

from the previous stage marginals.

Implements FactoredStateAOHDistribution.

References _m_oHistConditional, _m_oHistMarginals, _m_puf, _m_sfacMarginals, _m_sfacSoI_ii_size, _m_stage, _m_stepsize, Globals::CastLIndexToIndex(), Scope::Contains(), MultiAgentDecisionProcessDiscreteFactoredStatesInterface::Get2DBN(), JointPolicyDiscretePure::GetActionIndex(), TwoStageDynamicBayesianNetwork::GetASoI_O(), TwoStageDynamicBayesianNetwork::GetASoI_Y(), PlanningUnitFactoredDecPOMDPDiscrete::GetFDPOMDPD(), PlanningUnitMADPDiscrete::GetFirstObservationHistoryIndex(), PlanningUnitMADPDiscrete::GetNrActions(), PlanningUnitMADPDiscrete::GetNrAgents(), PlanningUnitMADPDiscrete::GetNrObservationHistories(), PlanningUnitMADPDiscrete::GetNrObservations(), MultiAgentDecisionProcessDiscreteFactoredStatesInterface::GetNrStateFactors(), MultiAgentDecisionProcessDiscreteFactoredStatesInterface::GetNrValuesForFactor(), MultiAgentDecisionProcessDiscreteFactoredStatesInterface::GetNrValuesPerFactor(), TwoStageDynamicBayesianNetwork::GetOProbabilitiesExactScopes(), TwoStageDynamicBayesianNetwork::GetOSoI_O(), Scope::GetPositionForIndex(), FSDist_COF::GetProbability(), FSDist_COF::GetReferrence(), PlanningUnitMADPDiscrete::GetSuccessorOHI(), TwoStageDynamicBayesianNetwork::GetXSoI_Y(), TwoStageDynamicBayesianNetwork::GetYProbabilitiesExactScopes(), TwoStageDynamicBayesianNetwork::GetYSoI_O(), IndexTools::Increment(), IndexTools::IndividualToJointIndicesStepSize(), IndexTools::RestrictIndividualIndicesToScope(), SanityCheck(), FSDist_COF::SetZero(), JointPolicyDiscretePure::SoftPrint(), and SoftPrint().

Member Data Documentation

std::vector< CPDDiscreteInterface* > FSAOHDist_NECOF::_m_oHistConditional
private

the conditional observation history probabilities

Referenced by FSAOHDist_NECOF(), GetXOHProb_relT(), GetXOHProb_relT_SufficientSFscope(), SanityCheck(), SoftPrint(), Update(), and ~FSAOHDist_NECOF().

std::vector< std::vector<double> > FSAOHDist_NECOF::_m_oHistMarginals
private

marginals of observation history probs for each agent

used for updating the belief and by the GetOH... functions _m_oHistMarginals[agI][ohI] contains the probability of observation history ohI for agent agI.

Referenced by GetOHProb_relT(), SanityCheck(), SoftPrint(), and Update().

const PlanningUnitFactoredDecPOMDPDiscrete* FSAOHDist_NECOF::_m_puf
private
FSDist_COF* FSAOHDist_NECOF::_m_sfacMarginals
private

the maintained state factor marginals

Referenced by GetXProb(), InitializeFromISD(), SanityCheck(), SoftPrint(), Update(), and ~FSAOHDist_NECOF().

std::vector< Scope > FSAOHDist_NECOF::_m_sfacSoI
private

the state factors in the scope of influence for each agent('s obs.)

Referenced by FSAOHDist_NECOF(), GetXOHProb_relT(), and GetXOHProb_relT_SufficientSFscope().

std::vector< size_t > FSAOHDist_NECOF::_m_sfacSoI_ii_size
private

the number of influence instantiations for those scopes

(i.e., the number of local states that influence o_i)

Referenced by FSAOHDist_NECOF(), and Update().

Index FSAOHDist_NECOF::_m_stage
private

The stage for which this distribution is.

Referenced by Update().

std::vector< size_t *> FSAOHDist_NECOF::_m_stepsize
private

the stepsize array (used to convert indiv<->joint indicies) is cached

I.e., this is used to quickly convert from/to individiual state indices of the state factors in the scope for this agent

Referenced by FSAOHDist_NECOF(), GetXOHProb_relT(), GetXOHProb_relT_SufficientSFscope(), Update(), and ~FSAOHDist_NECOF().