aGrUM  0.16.0
gum::InfluenceDiagramInference< GUM_SCALAR > Class Template Reference

<agrum/ID/inference/influenceDiagramInference.h> More...

#include <influenceDiagramInference.h>

+ Inheritance diagram for gum::InfluenceDiagramInference< GUM_SCALAR >:
+ Collaboration diagram for gum::InfluenceDiagramInference< GUM_SCALAR >:

Public Member Functions

const InfluenceDiagram< GUM_SCALAR > & influenceDiagram () const
 Returns a constant reference over the InfluenceDiagram on which this class work. More...
 
Constructor & destructor
 InfluenceDiagramInference (const InfluenceDiagram< GUM_SCALAR > &infDiag)
 Default constructor. More...
 
virtual ~InfluenceDiagramInference ()
 Destructor. More...
 
Inference
virtual void makeInference ()
 
GUM_SCALAR getMEU ()
 
Idx getBestDecisionChoice (NodeId decisionId)
 
std::string displayResult ()
 displays the result of an inference More...
 
Evidence management
virtual void insertEvidence (const List< const Potential< GUM_SCALAR > * > &evidenceList)
 
virtual void eraseEvidence (const Potential< GUM_SCALAR > *evidence)
 
virtual void eraseAllEvidence ()
 
Getters & setters
TriangulationgetTriangulation ()
 Returns the Triangulation used by this class. More...
 
void displayStrongJunctionTree (std::ostream &stream=std::cout)
 Displays on terminal the result of strong junction tree computation for test purpose only. More...
 

Protected Attributes

const InfluenceDiagram< GUM_SCALAR > & __infDiag
 The Bayes net we wish to perform inference on. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::InfluenceDiagramInference< GUM_SCALAR >

<agrum/ID/inference/influenceDiagramInference.h>

This class implements an algorithm for inference in influence diagrams based upon Shaffer-Shenoy's one for bayes net inferences

The class used for the triangulation is partialOrderedTriangulation.

Definition at line 64 of file influenceDiagramInference.h.

Constructor & Destructor Documentation

◆ InfluenceDiagramInference()

template<typename GUM_SCALAR >
gum::InfluenceDiagramInference< GUM_SCALAR >::InfluenceDiagramInference ( const InfluenceDiagram< GUM_SCALAR > &  infDiag)
explicit

Default constructor.

Parameters
infDiagthe influence diagram we want to perform inference upon

◆ ~InfluenceDiagramInference()

template<typename GUM_SCALAR >
virtual gum::InfluenceDiagramInference< GUM_SCALAR >::~InfluenceDiagramInference ( )
virtual

Destructor.

Member Function Documentation

◆ __absorbClique()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__absorbClique ( NodeId  absorbedCliqueId,
NodeId  absorbingCliqueId 
)
private

Performs the operation of absorption of a clique by another.

◆ __cleanUp()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__cleanUp ( )
private

Cleans Up remaining stuff due to inference.

◆ __collectChild()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__collectChild ( NodeId  parent,
NodeId  child 
)
private

collect child clique for inferences

◆ __getClique()

template<typename GUM_SCALAR >
NodeId gum::InfluenceDiagramInference< GUM_SCALAR >::__getClique ( const std::vector< NodeId > &  eliminationOrder,
NodeId  id 
)
private
Returns
Returns the clique in which the node's potentials must be stored

◆ __getSeparator()

template<typename GUM_SCALAR >
const NodeSet& gum::InfluenceDiagramInference< GUM_SCALAR >::__getSeparator ( NodeId  clique_1,
NodeId  clique_2 
)
private
Returns
Returns a separator given two adjacent cliques

◆ __IsEliminatedAfter()

template<typename GUM_SCALAR >
bool gum::InfluenceDiagramInference< GUM_SCALAR >::__IsEliminatedAfter ( NodeId  observedNode,
NodeId  currentNode 
)
private

Returns true if observed node is eliminated after current node.

◆ __makeCliquePropertiesMap()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__makeCliquePropertiesMap ( )
private

Builds the cliques tables Uses __getCliquesTable to initialize the cliques table, and multiply the tables with the adequate CPT.

◆ __makeDummyPotential()

template<typename GUM_SCALAR >
Potential< GUM_SCALAR >* gum::InfluenceDiagramInference< GUM_SCALAR >::__makeDummyPotential ( NodeId  cliqueId)
private

Returns a pointer over a "dummy" potential, which is a CPT filled with one MultiDimSparse filled with 1. This is used by empty cliques.

Parameters
cliqueIdThe NodeId of the cliqueId for which we build a dummy potential.
Returns
A pointer over the dummy bucket.

◆ __makeDummyUtility()

template<typename GUM_SCALAR >
Potential< GUM_SCALAR >* gum::InfluenceDiagramInference< GUM_SCALAR >::__makeDummyUtility ( NodeId  cliqueId)
private

Returns a pointer over a "dummy" utility, which is a utility table filled with one MultiDimSparse filled with 0. This is used by empty cliques.

Parameters
cliqueIdThe NodeId of the cliqueId for which we build a dummy utility.
Returns
A pointer over the dummy bucket.

◆ __makeStrongJunctionTree()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__makeStrongJunctionTree ( )
private

Makes a strong junction tree that make easier elimination.

◆ __reduceClique()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::__reduceClique ( CliqueProperties< GUM_SCALAR > *  absorbedClique,
NodeSet separator,
Potential< GUM_SCALAR > *&  potentialMarginal,
Potential< GUM_SCALAR > *&  utilityMarginal 
)
private

Reduces a clique down to her separator from another clique elements.

◆ displayResult()

template<typename GUM_SCALAR >
std::string gum::InfluenceDiagramInference< GUM_SCALAR >::displayResult ( )

displays the result of an inference

◆ displayStrongJunctionTree()

template<typename GUM_SCALAR >
void gum::InfluenceDiagramInference< GUM_SCALAR >::displayStrongJunctionTree ( std::ostream &  stream = std::cout)

Displays on terminal the result of strong junction tree computation for test purpose only.

◆ eraseAllEvidence()

template<typename GUM_SCALAR >
virtual void gum::InfluenceDiagramInference< GUM_SCALAR >::eraseAllEvidence ( )
virtual

◆ eraseEvidence()

template<typename GUM_SCALAR >
virtual void gum::InfluenceDiagramInference< GUM_SCALAR >::eraseEvidence ( const Potential< GUM_SCALAR > *  evidence)
virtual

◆ getBestDecisionChoice()

template<typename GUM_SCALAR >
Idx gum::InfluenceDiagramInference< GUM_SCALAR >::getBestDecisionChoice ( NodeId  decisionId)
virtual

◆ getMEU()

template<typename GUM_SCALAR >
GUM_SCALAR gum::InfluenceDiagramInference< GUM_SCALAR >::getMEU ( )
virtual

◆ getTriangulation()

template<typename GUM_SCALAR >
Triangulation& gum::InfluenceDiagramInference< GUM_SCALAR >::getTriangulation ( )

Returns the Triangulation used by this class.

◆ influenceDiagram()

template<typename GUM_SCALAR >
const InfluenceDiagram< GUM_SCALAR >& gum::IInfluenceDiagramInference< GUM_SCALAR >::influenceDiagram ( ) const
inherited

Returns a constant reference over the InfluenceDiagram on which this class work.

◆ insertEvidence()

template<typename GUM_SCALAR >
virtual void gum::InfluenceDiagramInference< GUM_SCALAR >::insertEvidence ( const List< const Potential< GUM_SCALAR > * > &  evidenceList)
virtual

◆ makeInference()

template<typename GUM_SCALAR >
virtual void gum::InfluenceDiagramInference< GUM_SCALAR >::makeInference ( )
virtual

Member Data Documentation

◆ __cliqueEliminationMap

template<typename GUM_SCALAR >
HashTable< Size, NodeId > gum::InfluenceDiagramInference< GUM_SCALAR >::__cliqueEliminationMap
private

Mapping of the nodes with the clique used to put their CPT.

Definition at line 164 of file influenceDiagramInference.h.

◆ __cliquePropertiesMap

template<typename GUM_SCALAR >
NodeProperty< CliqueProperties< GUM_SCALAR >* > gum::InfluenceDiagramInference< GUM_SCALAR >::__cliquePropertiesMap
private

Mapping of the nodes with the clique used to put their CPT.

Definition at line 162 of file influenceDiagramInference.h.

◆ __infDiag

template<typename GUM_SCALAR >
const InfluenceDiagram< GUM_SCALAR >& gum::IInfluenceDiagramInference< GUM_SCALAR >::__infDiag
protectedinherited

The Bayes net we wish to perform inference on.

Definition at line 111 of file IInfluenceDiagramInference.h.

◆ __inferenceMade

template<typename GUM_SCALAR >
bool gum::InfluenceDiagramInference< GUM_SCALAR >::__inferenceMade
private

Mapping of the nodes with the clique used to put their CPT.

Definition at line 168 of file influenceDiagramInference.h.

◆ __inferencePotential

template<typename GUM_SCALAR >
Potential< GUM_SCALAR >* gum::InfluenceDiagramInference< GUM_SCALAR >::__inferencePotential
private

The resulting potential from inference.

Definition at line 148 of file influenceDiagramInference.h.

◆ __inferenceUtility

template<typename GUM_SCALAR >
Potential< GUM_SCALAR >* gum::InfluenceDiagramInference< GUM_SCALAR >::__inferenceUtility
private

The resulting utility from inference.

Definition at line 151 of file influenceDiagramInference.h.

◆ __nodeToCliqueMap

template<typename GUM_SCALAR >
NodeProperty< NodeId > gum::InfluenceDiagramInference< GUM_SCALAR >::__nodeToCliqueMap
private

Mapping of the nodes with the clique used to put their CPT.

Definition at line 160 of file influenceDiagramInference.h.

◆ __potentialDummies

template<typename GUM_SCALAR >
Set< Potential< GUM_SCALAR >* > gum::InfluenceDiagramInference< GUM_SCALAR >::__potentialDummies
private

The set of dummies sparse potential matrix created.

Definition at line 142 of file influenceDiagramInference.h.

◆ __triangulation

template<typename GUM_SCALAR >
Triangulation* gum::InfluenceDiagramInference< GUM_SCALAR >::__triangulation
private

The triangulation algorithm.

Definition at line 139 of file influenceDiagramInference.h.

◆ __utakenDecisionMap

template<typename GUM_SCALAR >
HashTable< NodeId, Idx > gum::InfluenceDiagramInference< GUM_SCALAR >::__utakenDecisionMap
private

Mapping of the nodes with the clique used to put their CPT.

Definition at line 166 of file influenceDiagramInference.h.

◆ __utilityDummies

template<typename GUM_SCALAR >
Set< Potential< GUM_SCALAR >* > gum::InfluenceDiagramInference< GUM_SCALAR >::__utilityDummies
private

The set of dummies sparse utilities matrix created.

Definition at line 145 of file influenceDiagramInference.h.


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