42#ifndef __MULTIPLE_INFERENCE_ENGINES__H__
43#define __MULTIPLE_INFERENCE_ENGINES__H__
73 template <
typename GUM_SCALAR,
class BNInferenceEngine >
88 using _clusters_ = std::vector< std::vector< _cluster_ > >;
90 using _modals_ = std::vector< HashTable< std::string, std::vector< GUM_SCALAR > > >;
108 const std::vector< GUM_SCALAR >& vertex,
109 const bool& elimRedund);
133 typename std::vector< List< const Tensor< GUM_SCALAR >* >* >
workingSetE_;
163 const bool _storeVertices_,
164 const bool _storeBNOpt_);
185 const std::vector< GUM_SCALAR >& vertex,
186 const bool& elimRedund =
false);
259#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Class representing the minimal interface for Bayesian network with no numerical data.
Class template representing a Credal Network.
InferenceEngine(const CredalNet< GUM_SCALAR > &credalNet)
Construtor.
const CredalNet< GUM_SCALAR > & credalNet() const
Get this creadal network.
Class template representing a CredalNet inference engine using one or more IBayesNet inference engine...
void updateMarginals_()
Fusion of threads marginals.
virtual void makeInference()=0
To be redefined by each credal net algorithm.
_margis_ l_marginalMin_
Threads lower marginals, one per thread.
_expes_ l_expectationMax_
Threads upper expectations, one per thread.
_expes_ l_expectationMin_
Threads lower expectations, one per thread.
std::vector< _bnet_ * > workingSet_
Threads IBayesNet.
std::vector< BNInferenceEngine * > l_inferenceEngine_
Threads BNInferenceEngine.
_credalSets_ l_marginalSets_
Threads vertices.
std::vector< std::vector< _cluster_ > > _clusters_
std::vector< _margi_ > _margis_
NodeProperty< std::vector< GUM_SCALAR > > _margi_
NodeProperty< GUM_SCALAR > _expe_
void optFusion_()
Fusion of threads optimal IBayesNet.
_modals_ l_modal_
Threads modalities.
NodeProperty< std::vector< NodeId > > _cluster_
IBayesNet< GUM_SCALAR > _bnet_
InferenceEngine< GUM_SCALAR > _infE_
To easily access InferenceEngine< GUM_SCALAR > methods.
std::vector< VarMod2BNsMap< GUM_SCALAR > * > l_optimalNet_
Threads optimal IBayesNet.
void updateOldMarginals_()
Update old marginals (from current marginals).
_margis_ l_marginalMax_
Threads upper marginals, one per thread.
NodeProperty< std::vector< std::vector< GUM_SCALAR > > > _credalSet_
MultipleInferenceEngine(const CredalNet< GUM_SCALAR > &credalNet)
Constructor.
void expFusion_()
Fusion of threads expectations.
void initThreadsData_(const Size &num_threads, const bool _storeVertices_, const bool _storeBNOpt_)
Initialize threads data.
virtual ~MultipleInferenceEngine()
Destructor.
const GUM_SCALAR computeEpsilon_()
Compute epsilon and update old marginals.
virtual void eraseAllEvidence()
Erase all inference related data to perform another one.
bool updateThread_(Size this_thread, const NodeId &id, const std::vector< GUM_SCALAR > &vertex, const bool &elimRedund=false)
Update thread information (marginals, expectations, IBayesNet, vertices) for a given node id.
std::vector< List< const Tensor< GUM_SCALAR > * > * > workingSetE_
Threads evidence.
std::vector< std::mt19937 > generators_
the generators used for computing random values
std::vector< _expe_ > _expes_
_margis_ l_evidence_
Threads evidence.
std::vector< HashTable< std::string, std::vector< GUM_SCALAR > > > _modals_
void _updateThreadCredalSets_(Size this_thread, const NodeId &id, const std::vector< GUM_SCALAR > &vertex, const bool &elimRedund)
Ask for redundancy elimination of a node credal set of a calling thread.
_clusters_ l_clusters_
Threads clusters.
std::vector< _credalSet_ > _credalSets_
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Abstract class representing CredalNet inference engines.
Implementation of a Shafer-Shenoy's-like version of lazy propagation for inference in Bayesian networ...
namespace for all credal networks entities
gum is the global namespace for all aGrUM entities