30 #ifndef GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 31 #define GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 35 #include <agrum/BN/inference/tools/BayesNetInference.h> 36 #include <agrum/agrum.h> 55 template <
typename GUM_SCALAR >
56 class MarginalTargetedInference:
public virtual BayesNetInference< GUM_SCALAR > {
133 virtual void addTarget(NodeId target)
final;
139 virtual void addTarget(
const std::string& nodeName)
final;
149 virtual void eraseTarget(
const std::string& nodeName)
final;
152 virtual bool isTarget(NodeId node)
const final;
155 virtual bool isTarget(
const std::string& nodeName)
const final;
174 virtual GUM_SCALAR
H(NodeId X)
final;
180 virtual GUM_SCALAR
H(
const std::string& nodeName)
final;
256 #include <agrum/BN/inference/tools/marginalTargetedInference_tpl.h> bool _targeted_mode_
whether the actual targets are default
void _setAllMarginalTargets_()
sets all the nodes of the Bayes net as targets
virtual GUM_SCALAR H(NodeId X) final
Entropy Compute Shanon's entropy of a node given the observation.
virtual void onModelChanged_(const GraphicalModel *bn)
fired after a new Bayes net has been assigned to the engine
virtual void eraseTarget(NodeId target) final
removes an existing (marginal) target
virtual void addTarget(const std::string &nodeName) final
Add a marginal target to the list of targets.
virtual void eraseTarget(const std::string &nodeName) final
removes an existing (marginal) target
INLINE void emplace(Args &&... args)
virtual const Size nbrTargets() const noexcept final
returns the number of marginal targets
Potential< GUM_SCALAR > evidenceImpact(const std::string &target, const std::vector< std::string > &evs)
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) ...
virtual bool isTarget(NodeId node) const final
return true if variable is a (marginal) target
virtual void onAllMarginalTargetsErased_()=0
fired before a all marginal targets are removed
virtual void onMarginalTargetAdded_(const NodeId id)=0
fired after a new marginal target is inserted
virtual void addTarget(NodeId target) final
Add a marginal target to the list of targets.
bool isTargetedMode_() const
virtual void addAllTargets() final
adds all nodes as targets
virtual const Potential< GUM_SCALAR > & posterior(const std::string &nodeName)
Computes and returns the posterior of a node.
virtual const Potential< GUM_SCALAR > & posterior(NodeId node)
Computes and returns the posterior of a node.
virtual const Potential< GUM_SCALAR > & posterior_(NodeId id)=0
asks derived classes for the posterior of a given variable
virtual bool isTarget(const std::string &nodeName) const final
return true if variable is a (marginal) target
Potential< GUM_SCALAR > evidenceImpact(NodeId target, const NodeSet &evs)
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) ...
virtual GUM_SCALAR H(const std::string &nodeName) final
Entropy Compute Shanon's entropy of a node given the observation.
virtual const NodeSet & targets() const noexcept final
returns the list of marginal targets
virtual void eraseAllTargets()
Clear all previously defined targets.
NodeSet _targets_
the set of marginal targets
virtual void onAllMarginalTargetsAdded_()=0
fired after all the nodes of the BN are added as marginal targets
virtual ~MarginalTargetedInference()
destructor
virtual void onMarginalTargetErased_(const NodeId id)=0
fired before a marginal target is removed
MarginalTargetedInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor