28 #ifndef GUM_BAYES_NET_INFERENCE_H 29 #define GUM_BAYES_NET_INFERENCE_H 59 template <
typename GUM_SCALAR >
65 template <
typename GUM_SCALAR >
71 template <
typename GUM_SCALAR >
138 template <
typename GUM_SCALAR >
182 OutdatedBNPotentials,
237 virtual bool isInferenceReady()
const noexcept
final;
239 virtual bool isInferenceOutdatedBNStructure()
const noexcept
final;
241 virtual bool isInferenceOutdatedBNPotentials()
const noexcept
final;
243 virtual bool isInferenceDone()
const noexcept
final;
251 virtual bool isDone()
const noexcept
final;
254 virtual void prepareInference()
final;
262 virtual void makeInference()
final;
265 virtual void clear();
283 virtual void addEvidence(
NodeId id,
const Idx val)
final;
291 virtual void addEvidence(
const std::string& nodeName,
const Idx val)
final;
299 virtual void addEvidence(
NodeId id,
const std::string& label)
final;
307 virtual void addEvidence(
const std::string& nodeName,
308 const std::string& label)
final;
318 virtual void addEvidence(
NodeId id,
319 const std::vector< GUM_SCALAR >& vals)
final;
329 virtual void addEvidence(
const std::string& nodeName,
330 const std::vector< GUM_SCALAR >& vals)
final;
375 virtual void addListOfEvidence(
384 virtual void chgEvidence(
NodeId id,
const Idx val)
final;
392 virtual void chgEvidence(
const std::string& nodeName,
const Idx val)
final;
400 virtual void chgEvidence(
NodeId id,
const std::string& label)
final;
408 virtual void chgEvidence(
const std::string& nodeName,
409 const std::string& label)
final;
419 virtual void chgEvidence(
NodeId id,
420 const std::vector< GUM_SCALAR >& vals)
final;
430 virtual void chgEvidence(
const std::string& nodeName,
431 const std::vector< GUM_SCALAR >& vals)
final;
445 virtual void eraseAllEvidence()
final;
448 virtual void eraseEvidence(
NodeId id)
final;
451 virtual void eraseEvidence(
const std::string& nodeName)
final;
454 virtual bool hasEvidence()
const final;
457 virtual bool hasEvidence(
NodeId id)
const final;
460 virtual bool hasHardEvidence(
NodeId id)
const final;
463 virtual bool hasSoftEvidence(
NodeId id)
const final;
466 virtual bool hasEvidence(
const std::string& nodeName)
const final;
469 virtual bool hasHardEvidence(
const std::string& nodeName)
const final;
472 virtual bool hasSoftEvidence(
const std::string& nodeName)
const final;
475 virtual Size nbrEvidence()
const final;
478 virtual Size nbrHardEvidence()
const final;
481 virtual Size nbrSoftEvidence()
const final;
487 const NodeSet& softEvidenceNodes()
const;
490 const NodeSet& hardEvidenceNodes()
const;
500 virtual void _onStateChanged() = 0;
503 virtual void _onEvidenceAdded(
const NodeId id,
bool isHardEvidence) = 0;
506 virtual void _onEvidenceErased(
const NodeId id,
bool isHardEvidence) = 0;
509 virtual void _onAllEvidenceErased(
bool contains_hard_evidence) = 0;
519 virtual void _onEvidenceChanged(
const NodeId id,
bool hasChangedSoftHard) = 0;
528 virtual void _updateOutdatedBNStructure() = 0;
534 virtual void _updateOutdatedBNPotentials() = 0;
538 virtual void _makeInference() = 0;
561 void _setOutdatedBNStructureState();
572 void _setOutdatedBNPotentialsState();
609 void __computeDomainSizes();
628 #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
Implementation of the non pure virtual methods of class BayesNetInference.
Class representing Bayesian networks.
<agrum/BN/inference/marginalTargetedInference.h>
Generic doubly linked lists.
Class representing the minimal interface for Bayesian Network.
gum is the global namespace for all aGrUM entities
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.