31 #ifndef GUM_BAYES_NET_INFERENCE_H 32 #define GUM_BAYES_NET_INFERENCE_H 62 template <
typename GUM_SCALAR >
68 template <
typename GUM_SCALAR >
74 template <
typename GUM_SCALAR >
141 template <
typename GUM_SCALAR >
185 OutdatedBNPotentials,
240 virtual bool isInferenceReady()
const noexcept
final;
242 virtual bool isInferenceOutdatedBNStructure()
const noexcept
final;
244 virtual bool isInferenceOutdatedBNPotentials()
const noexcept
final;
246 virtual bool isInferenceDone()
const noexcept
final;
254 virtual bool isDone()
const noexcept
final;
257 virtual void prepareInference()
final;
265 virtual void makeInference()
final;
268 virtual void clear();
286 virtual void addEvidence(
NodeId id,
const Idx val)
final;
294 virtual void addEvidence(
const std::string& nodeName,
const Idx val)
final;
302 virtual void addEvidence(
NodeId id,
const std::string& label)
final;
310 virtual void addEvidence(
const std::string& nodeName,
311 const std::string& label)
final;
321 virtual void addEvidence(
NodeId id,
322 const std::vector< GUM_SCALAR >& vals)
final;
332 virtual void addEvidence(
const std::string& nodeName,
333 const std::vector< GUM_SCALAR >& vals)
final;
378 virtual void addListOfEvidence(
387 virtual void chgEvidence(
NodeId id,
const Idx val)
final;
395 virtual void chgEvidence(
const std::string& nodeName,
const Idx val)
final;
403 virtual void chgEvidence(
NodeId id,
const std::string& label)
final;
411 virtual void chgEvidence(
const std::string& nodeName,
412 const std::string& label)
final;
422 virtual void chgEvidence(
NodeId id,
423 const std::vector< GUM_SCALAR >& vals)
final;
433 virtual void chgEvidence(
const std::string& nodeName,
434 const std::vector< GUM_SCALAR >& vals)
final;
448 virtual void eraseAllEvidence()
final;
451 virtual void eraseEvidence(
NodeId id)
final;
454 virtual void eraseEvidence(
const std::string& nodeName)
final;
457 virtual bool hasEvidence()
const final;
460 virtual bool hasEvidence(
NodeId id)
const final;
463 virtual bool hasHardEvidence(
NodeId id)
const final;
466 virtual bool hasSoftEvidence(
NodeId id)
const final;
469 virtual bool hasEvidence(
const std::string& nodeName)
const final;
472 virtual bool hasHardEvidence(
const std::string& nodeName)
const final;
475 virtual bool hasSoftEvidence(
const std::string& nodeName)
const final;
478 virtual Size nbrEvidence()
const final;
481 virtual Size nbrHardEvidence()
const final;
484 virtual Size nbrSoftEvidence()
const final;
490 const NodeSet& softEvidenceNodes()
const;
493 const NodeSet& hardEvidenceNodes()
const;
503 virtual void _onStateChanged() = 0;
506 virtual void _onEvidenceAdded(
const NodeId id,
bool isHardEvidence) = 0;
509 virtual void _onEvidenceErased(
const NodeId id,
bool isHardEvidence) = 0;
512 virtual void _onAllEvidenceErased(
bool contains_hard_evidence) = 0;
522 virtual void _onEvidenceChanged(
const NodeId id,
bool hasChangedSoftHard) = 0;
531 virtual void _updateOutdatedBNStructure() = 0;
537 virtual void _updateOutdatedBNPotentials() = 0;
541 virtual void _makeInference() = 0;
564 void _setOutdatedBNStructureState();
575 void _setOutdatedBNPotentialsState();
612 void __computeDomainSizes();
631 #endif // GUM_BAYES_NET_INFERENCE_H aGrUM's Potential is a multi-dimensional array with tensor operators.
NodeProperty< const Potential< GUM_SCALAR > *> __evidence
the set of evidence entered into the network
NodeProperty< Size > __domain_sizes
the domain sizes of the random variables
NodeProperty< Idx > __hard_evidence
assign to each node with a hard evidence the index of its observed value
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/BN/inference/marginalTargetedInference.h>
Generic doubly linked lists.
Class representing the minimal interface for Bayesian Network.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
Representation of a setA Set is a structure that contains arbitrary elements.
<agrum/BN/inference/BayesNetInference.h>
FindBarrenNodesType
type of algorithm to determine barren nodes
NodeSet __soft_evidence_nodes
the set of nodes that received soft evidence
<agrum/BN/inference/jointTargetedInference.h>
NodeSet __hard_evidence_nodes
the set of nodes that received hard evidence
Size Idx
Type for indexes.
<agrum/BN/inference/evidenceInference.h>
std::size_t Size
In aGrUM, hashed values are unsigned long int.
StateOfInference
current state of the inference
Size NodeId
Type for node ids.